Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
101
rated 0 times [  107] [ 6]  / answers: 1 / hits: 92960  / 12 Years ago, wed, september 26, 2012, 12:00:00

This is an error in Firebug I keep seeing.



TypeError: $(#gallery-nav-button) is null
[Break On This Error]
$('#gallery-nav-button').addClass('animated fadeOutRightBig');


Here is my code:



JS



$(function() {
$(#close-gallery-nav-button).click(function() {
$('#gallery-nav-button').addClass('animated fadeOutRightBig');
});
});


HTML



<div id=gallery-nav-button>
<h4 id=close-gallery-nav-button>X</h4>
<h3 class=text-center small-text><a class=inline text-center small-text href=#gallery-nav-instruct>Click Here for Gallery <br /> Navigation Instructions.</a></h3>
</div>


CSS



#close-gallery-nav-button{
text-indent:-9999px;
width:20px;
height:20px;
position:absolute;
top:-20px;
background:url(/images/controls.png) no-repeat 0 0;
}
#close-gallery-nav-button{background-position:-50px 0px; right:0;}
#close-gallery-nav-button:hover{background-position:-50px -25px;}

More From » jquery

 Answers
14

I have several scripts running on this page and evidently one script was conflicting with another. To solve my issue I added jQuery.noConflict();



var $j = jQuery.noConflict();
$j(function() {
$j(#close-gallery-nav-button).click(function() {
$j('#gallery-nav-button').addClass('animated fadeOutRightBig');
});
});

[#82891] Tuesday, September 25, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
janjadonb

Total Points: 4
Total Questions: 114
Total Answers: 118

Location: Mali
Member since Fri, Dec 3, 2021
3 Years ago
janjadonb questions
;