-2

Uncaught TypeError: $(...).(thefuntionname) is not a function

this is always the error i had in my website can someone help me. its already under a function({});. what should I do?

and sometimes even if theres an error the code still runs right.

the error : Uncaught TypeError: $(...).opacityrollover is not a function

the code:

Blockquote

        jQuery(document).ready(function($){
            $('div.content').css('display', 'block');

            var onMouseOutOpacity = 0.67;
            $('#thumbs ul.thumbs li, div.navigation a.pageLink').opacityrollover({
                mouseOutOpacity:   onMouseOutOpacity,
                mouseOverOpacity:  1.0,
                fadeSpeed:         'fast',
                exemptionSelector: '.selected'
            });



    });

Blockquote

Ivan Orpilla
  • 13
  • 1
  • 4
  • these will be the example the error : Uncaught TypeError: $(...).opacityrollover is not a function the code: jQuery(document).ready(function($){ $('div.content').css('display', 'block'); var onMouseOutOpacity = 0.67; $('#thumbs ul.thumbs li, div.navigation a.pageLink').opacityrollover({ mouseOutOpacity: onMouseOutOpacity, mouseOverOpacity: 1.0, fadeSpeed: 'fast', exemptionSelector: '.selected' }); }); – Ivan Orpilla Jun 26 '15 at 06:59
  • 1
    That looks like a syntax error. Can you please add your code to the question. – Rory McCrossan Jun 26 '15 at 07:00
  • Please add relevant code. – JackWhiteIII Jun 26 '15 at 07:03
  • try adding a semi-colon in front of the function (as pointed out here http://stackoverflow.com/questions/10429838/uncaught-typeerror-undefined-is-not-a-function-on-loading-jquery-min-js) – Alex Tartan Jun 26 '15 at 07:04
  • Have you your opacityrollover loaded to your page? Check in console. – Beri Jun 26 '15 at 07:20
  • Beri - yep actually the function work okay.. – Ivan Orpilla Jun 26 '15 at 09:13

1 Answers1

0

Looks like there is a conflict

Replace the $ with jQuery

jQuery(document).ready(function($){
            jQuery('div.content').css('display', 'block');

            var onMouseOutOpacity = 0.67;
            jQuery('#thumbs ul.thumbs li, div.navigation a.pageLink').opacityrollover({
                mouseOutOpacity:   onMouseOutOpacity,
                mouseOverOpacity:  1.0,
                fadeSpeed:         'fast',
                exemptionSelector: '.selected'
            });

    });

opacityrollover is not available by default in jQuery, you need to add that function from the below url https://code.google.com/p/galleriffic/source/browse/trunk/jalbum-skin/res/jquery.opacityrollover.js?r=31

Vignesh Subramanian
  • 7,161
  • 14
  • 87
  • 150