Jquery Help!!
Posted: Tue Aug 23, 2011 3:56 am
Hi Guys,
I found this JQuery function that I would like to modify for use in my website, the problem is I am no good at Jquery, can someone please help.
The first issue is I would like to have it show a div only if the id/values is 1, if it is another figure then I would like it to show another div, is this possible?
Also is there a way to get it to load on entry to the page??
Thanks a lot in advanced.
pickle | Please use [ syntax=php ], [ syntax=text ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:
Posting Code in the Forums to learn how to do it too.
I found this JQuery function that I would like to modify for use in my website, the problem is I am no good at Jquery, can someone please help.
Code: Select all
$(function() {
$('#baskethide').change(function(){
$('.colors').hide();
$('#' + $(this).val()).show();
});
});
Code: Select all
<Select id="baskethide">
<option value="1">Red</option>
<option value="2">Yellow</option>
<option value="1">Blue</option>
</Select>
<div id="1" class="colors" style="display:none"> red... </div>
<div id="2" class="colors" style="display:none"> yellow.. </div>
<div id="1" class="colors" style="display:none"> blue.. </div>
The first issue is I would like to have it show a div only if the id/values is 1, if it is another figure then I would like it to show another div, is this possible?
Also is there a way to get it to load on entry to the page??
Thanks a lot in advanced.
pickle | Please use [ syntax=php ], [ syntax=text ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: