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

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 10-03-2012, 08:36 AM   PM User | #1
Samz3n
New Coder

 
Join Date: Apr 2010
Posts: 67
Thanks: 30
Thanked 0 Times in 0 Posts
Samz3n is an unknown quantity at this point
Smile Help with Jquery Slide Toggle Fallback

Hello there..

I need to make some kind of fallback to my Jquery slide toggle so it is just a link/button for browsers with no java supported. Can anyone help me?

Javascript:
Code:
$(document).ready(function(){
$("#inkassobox").toggle(function(){
$("#inkassobox").animate({'height': '280px'});
	}, function(){
$("#inkassobox").animate({'height': '125px'});
	});
$("#links").click(function(event){
	event.stopPropagation();
	});
});
http://www.shanem.dk/hornvind
Samz3n is offline   Reply With Quote
Old 10-03-2012, 10:37 AM   PM User | #2
VIPStephan
The fat guy next door


 
VIPStephan's Avatar
 
Join Date: Jan 2006
Location: Halle (Saale), Germany
Posts: 7,587
Thanks: 5
Thanked 864 Times in 841 Posts
VIPStephan is a jewel in the roughVIPStephan is a jewel in the roughVIPStephan is a jewel in the rough
First of all, I appreciate that you’re thinking about a fallback at all. Most people just implement technologies without thinking any further.

Then, one thing I’m always doing right in the beginning is to add a class to the body (or html root element) using JS which serves as my hook to apply specific styles that are only seen if JS is enabled. The reverse approach (which is used by some people, too) would be to add a “no JS” class to the html and remove it with JS then. This way you can do the following with your box: If JS is not available/enabled then make it a simple CSS hover function.
Code:
#inkassobox:hover {height: 280px;}
__________________
Don’t click this link!
VIPStephan is offline   Reply With Quote
Users who have thanked VIPStephan for this post:
Samz3n (10-03-2012)
Old 10-03-2012, 02:16 PM   PM User | #3
Samz3n
New Coder

 
Join Date: Apr 2010
Posts: 67
Thanks: 30
Thanked 0 Times in 0 Posts
Samz3n is an unknown quantity at this point
Thank you very much for your appreciating

In my case it is very important, that my site is supported by almost every browsers (with or without java, transitions etc.)

I think I will just go with the hover effect and disable the jquery on #inkassobox
I like it better this way! (And if I want some animation, later I can add some css3 transition to it)

Thank you for your help Stephan
Samz3n 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 12:18 AM.


Advertisement
Log in to turn off these ads.