Skip to main content
October 19, 2006
Question

Show/Hide Layers

  • October 19, 2006
  • 1 reply
  • 286 views
I have a page that has a verticle list of topics and a show/hide behavior applied to provide more detailed information to the end user. The problem is that when you scroll down the page and then click on the link to show the hidden layer, it shows the layer but it also snaps back up to the top of the page so you have to scroll back down to view the contents of the layer. The same thing happens when you close the layer. Anybody have any thoughts. Thanks.
This topic has been closed for replies.

1 reply

Inspiring
October 19, 2006
Show me your page and I'll tell you the simple way to fix it.

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================


"ptrefny" <webforumsuser@macromedia.com> wrote in message
news:eh891o$cip$1@forums.macromedia.com...
>I have a page that has a verticle list of topics and a show/hide behavior
> applied to provide more detailed information to the end user. The problem
> is
> that when you scroll down the page and then click on the link to show the
> hidden layer, it shows the layer but it also snaps back up to the top of
> the
> page so you have to scroll back down to view the contents of the layer.
> The
> same thing happens when you close the layer. Anybody have any thoughts.
> Thanks.
>


Inspiring
October 19, 2006
Rule 1 -

Never apply behaviors/events directly to <p> tags -

<p class="style2"
onclick="MM_showHideLayers('Layer1','','show')"><strong>Allied World
Assurance Company</strong>

That's not going to work reliably. All behaviors/events should be applied
to <a> tags (mostly), like this -

<a href="#" onclick="MM_showHideLayers('awa','','show')">more</a>

Rule 2 -

When you use "#" links, add a return false to the behavior call, e.g., -

<a href="#" onclick="MM_showHideLayers('awa','','show');return
false">more</a>

Now you're cooking with gas....

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================


"ptrefny" <webforumsuser@macromedia.com> wrote in message
news:eh8a47$dte$1@forums.macromedia.com...
> Here it is,
>
> http://www.farmingtoncapital.com/porfolio.asp
>
> Thanks.