Forum Moderators: open

Message Too Old, No Replies

hidden text woes

scrollbar & refresh problem

         

jmcdevitt

1:50 pm on Oct 24, 2003 (gmt 0)

10+ Year Member



Hey...I'm new to the collapsible text. I have a shopping cart that I have a button on each item to lengthen the description and when I scroll down to an item below the initial items showing on the screen...if I click the button to show the description it refreshes and moves the vertical scrollbar to the top. When you scroll back down to see the description, it is there. I just don't want customers to be taken back to the top everytime they scroll and click the description button.
------------------------------
Head tag
-------------------------------
<script type="text/javascript">
function show_hide(sh1)
{
obj=document.getElementById(sh1)
obj.style.display == "block"? obj.style.display = "none" : obj.style.display = "block"; // {
}
</script>
<style type="text/css">
span
{
display: none;
position: relative;
}
</style>
--------------------------------------
Body tag
--------------------------------------
<a href="#" onCLick="show_hide('s3')">
<img border="0" src="arrowbuy.gif" width="65" height="11"></a>
<br>
<span id="s3">
<U>Program Description:</U> Just a full paragraph worth of info....blah blah blah></span>

korkus2000

2:12 pm on Oct 24, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Change your anchor tag to this and give it a shot:

<a href="javascript:show_hide('s3')">

jmcdevitt

3:57 pm on Oct 24, 2003 (gmt 0)

10+ Year Member



Thanks a lot! It works perfect!