Connecting Tech Pros Worldwide Forums | Help | Site Map

Positioning dynamically created panel

Member
 
Join Date: Nov 2008
Posts: 39
#1: Jul 9 '09
Hi,


we have designed an online shopping website.in that we r displaying the online products
for all the products we hve a buy button and details button which is created dynamically
on click of details buttons we r showing a window which is also
created dynamically.actually the window is a panel and we r dynamically changing the content inside the panel for ecah product
my problem is that nw if i click on the details button it is comin according to the css settings
that i'm givin as absolute and seeting left and top for that....
my requirement is i want the detail window to come near the detail button of each product
if i scroll down to the last product and if i press detail button it should cme near
the detail button not on top where i hve positioned

Frinavale's Avatar
Site Moderator
 
Join Date: Oct 2006
Location: The Great White North
Posts: 5,120
#2: Jul 9 '09

re: Positioning dynamically created panel


This is going to have to be done using JavaScript....probably in the JavaScript method you're using to display the details section.

You'll have to modify it so that it moves the details section (the window/panel/<div>) to the correct place.

The only way you're going to know where this correct place is located you'll have to have a point of reference: the Details Button that was clicked.

So, modify your JavaScript function so that it accepts a parameter. That parameter being a reference to the details button element. Use this element's properties to determine where the details section should be displayed.

Make sense?

-Frinny
Reply


Similar ASP.NET bytes