Here's my stage:
- $.cookie (plug-in)
- $('#effects') (checkbox)
- init_options (function)
Now, take a look at this slightly messy code:
function init_options()
{
var $init_val = $.cookie('effects') ? $.cookie('effects') : "true";
$("#effects")
.attr("checked", $init_val)
.trigger("change");
}
$(function()
{
init_options();
$("#effects").bind("change", function()
{
alert("CHANGED")
$.fx.off = !$("#effects").attr("checked");
$.cookie('effects', !$("#effects").attr("checked"));
});
});
When I click my checkbox ($('#effects')), I get the "CHANGED" alert, however when I call the trigger("change") function, I get no alert?
I previously tried to use the trigger function, and I gave up. I could not get it to work, regardless of trying many different methods.
I hope you can help,
Thanks for any help - always appreciated!
-huzi
This post has been edited by huzi8t9: 01 September 2010 - 11:04 AM

New Topic/Question
Reply



MultiQuote



|