uandme72
11-25-2008, 05:31 AM
have a rather long page in which I would like to have certain DIVs show or hide by clicking on a link (one link per DIV). I am creating all the DIV dynamically using ASP database and populating the text inside DIV using AJAX which is triggered at onClick event of the link.
I have two issues:
1. I created the script, but the problem is that when I trigger the function from an onclick event from within a link, the page scrolls back to the top of the page. I would like to be able to trigger the onclick event without the page scrolling from it's current position in the browser window.
I tried using the "#" in the href attribute, but that makes the page scroll to the top. I tried leaving off the href attribute, but then the link becomes an anchor and does not appear to the user as a link (the pointer does not become a hand and the link is not styled as a link). I even tried creating anchors to use in the href attribute, but that still scrolls the page. I would ideally like the browser window to not move at all.
2. I dont want the AJX script to fetch the record everytime the link is clicked. The AJAX server script ASP page should be called only the first time the link is clicked.
Please help.
I have two issues:
1. I created the script, but the problem is that when I trigger the function from an onclick event from within a link, the page scrolls back to the top of the page. I would like to be able to trigger the onclick event without the page scrolling from it's current position in the browser window.
I tried using the "#" in the href attribute, but that makes the page scroll to the top. I tried leaving off the href attribute, but then the link becomes an anchor and does not appear to the user as a link (the pointer does not become a hand and the link is not styled as a link). I even tried creating anchors to use in the href attribute, but that still scrolls the page. I would ideally like the browser window to not move at all.
2. I dont want the AJX script to fetch the record everytime the link is clicked. The AJAX server script ASP page should be called only the first time the link is clicked.
Please help.