$(function() {
$(".button").hover(function() { $(this).addClass("hover"); }, function() { $(this).removeClass("hover"); });
$(".button").click(function(event) {
$(".button").removeClass("selected");
$(this).addClass("selected");
if (event.target.id == "switcher-default")
$("div#chpt").removeClass();
else if (event.target.id == "switcher-narrow")
$("div#chpt").removeClass().addClass("narrow");
else
$("div#chpt").removeClass().addClass("large");
event.stopPropagation(); });
$("#switcher").click(function() {
if (!((#chpt).hasClass("narrow")) && !((#chpt).hasClass("large")))
$(".button").toggleClass("hidden");
});
});
When the page loads, neither is their backgrounds turning green and cursor is becoming pointer when the mouse hovers over the buttons, not anything is happening when the switcher is clicked upon, be it outside the buttons or inside them. Please help me find the bug (or bugs)! Thank you!
This post has been edited by macosxnerd101: 06 February 2011 - 12:23 PM
Reason for edit:: Title renamed to be more descriptive.

New Topic/Question
Reply



MultiQuote



|