Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-17-2004, 10:14 AM   PM User | #1
sweenster
Regular Coder

 
Join Date: Sep 2002
Location: Scotland
Posts: 407
Thanks: 0
Thanked 0 Times in 0 Posts
sweenster is an unknown quantity at this point
cross-browser sliding div's

thanks to cross-browser.com i've borrowed some code and produced:

http://www.whatsinmypocket.co.uk/vir...site/index.htm

BUT here comes the next part...
The link above works fine if you put the mouse over the appropriate div. What i would like to do instead is have the new div slide down upon clicking of the link rather than just mouse over. any ideas??
__________________
My body's a temple... and like those ancient Greek ones it's a ruin
sweenster.co.uk
sweenster is offline   Reply With Quote
Old 08-17-2004, 10:51 AM   PM User | #2
jbot
Senior Coder

 
Join Date: Feb 2004
Location: Edinburgh
Posts: 1,352
Thanks: 0
Thanked 0 Times in 0 Posts
jbot is an unknown quantity at this point
Quote:
Originally Posted by sweenster
What i would like to do is have the new div slide down upon clicking of the link rather than just mouse over.
that's a nice effect.

if you change the event to onclick as opposed to onmouseover, won't that do wot you want? also, don't use JS URLs, since it's not accessible and prevents you from using a viable alternative, ie a genuine link for non-JS browsers.
jbot is offline   Reply With Quote
Old 08-17-2004, 04:51 PM   PM User | #3
sweenster
Regular Coder

 
Join Date: Sep 2002
Location: Scotland
Posts: 407
Thanks: 0
Thanked 0 Times in 0 Posts
sweenster is an unknown quantity at this point
if only it were that simple!

http://cross-browser.com/x/examples/slideouts.html was the original code that i downloaded and modified (http://cross-browser.com/toys/ for script download if you're interested)

The external javascript makes the page cross-browser compatible. I'm going to add a non-javascript enabled page later on.
__________________
My body's a temple... and like those ancient Greek ones it's a ruin
sweenster.co.uk
sweenster is offline   Reply With Quote
Old 08-18-2004, 06:46 PM   PM User | #4
MikeFoster
Regular Coder

 
Join Date: May 2004
Location: Alabama, USA
Posts: 237
Thanks: 0
Thanked 0 Times in 0 Posts
MikeFoster is an unknown quantity at this point
Hi sweenster,

I'm glad you like my toys, and I really like how you're using them on your page :-)

A few comments...

1) I've been removing the use of xInclude() from the demos. Obviously I missed the slideOut demo ;-). xInclude() was a fun little experiment, but it's overkill and causes more problems than it solves. I've now updated the slideOut demo to not use it.

2) I have another demo (just recently completed) which may be more appropriate for your application. Check out the xSlideMenu1 demo.

Thanks!
__________________
Cross-Browser.com, Home of the X Library
MikeFoster is offline   Reply With Quote
Old 08-18-2004, 11:05 PM   PM User | #5
sweenster
Regular Coder

 
Join Date: Sep 2002
Location: Scotland
Posts: 407
Thanks: 0
Thanked 0 Times in 0 Posts
sweenster is an unknown quantity at this point
Quote:
Originally Posted by MikeFoster
Hi sweenster,

I'm glad you like my toys, and I really like how you're using them on your page
Aw shucks!

I've used that new menu script to produce:
http://www.whatsinmypocket.co.uk/vir...site/index.htm

Still a slight problem with it though - whenever the user clicks to activate a link, if the previous one is still open the new one tumbles down without closing the original one, but i'll think up something for that i'm sure.

Also, in firefox it works ok wherever you click, but in IE it works if you click the anywhere in the div EXCEPT over the text. weird....
__________________
My body's a temple... and like those ancient Greek ones it's a ruin
sweenster.co.uk
sweenster is offline   Reply With Quote
Old 08-19-2004, 05:28 PM   PM User | #6
MikeFoster
Regular Coder

 
Join Date: May 2004
Location: Alabama, USA
Posts: 237
Thanks: 0
Thanked 0 Times in 0 Posts
MikeFoster is an unknown quantity at this point
I worked a little more on the xMenu1 Demo, and added another variation which is closer to what you need: menu opens onclick, closes onclick, and when opening closes all other open menus.

(sorry about changing names on ya )
__________________
Cross-Browser.com, Home of the X Library
MikeFoster is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:21 PM.


Advertisement
Log in to turn off these ads.