Jquery color box is not a function

50 Views Asked by At

Requirement :I need open pop up using jquery colorbox plugin

These are sequence of plugins which i am using using :

<script type="text/javascript" src="/newUI/jQuery/jquery.min.js"></script>
<script type="text/javascript" src="/newUI/jQuery/plugins/colorbox/jquery.colorbox-min.js"></script>
<link media="screen" rel="stylesheet" type="text/css" href="/newUI/jQuery/plugins/colorbox/colorbox.css" />

Below javascript function :

function XXXXXXXXX() {   
    jQuery.colorbox(
        {
            overlayClose:true,
            href:"/newUI/new.jsp",
            onClosed:removeColor,
            innerHeight:280 , 
            scrolling:false
        }
    );
} 

Error message : I am getting jquery colorbox is not a function , actually few pages its working fine and few pages its not working need some assistance on this issue.

Error message

Expected :Onclick of hyper link pop up message should open using jquery colorbox Expected Output

1

There are 1 best solutions below

0
DesignbyDC On

Ensure that your code is executed after the DOM is fully loaded. You can do this by wrapping your code in a document.ready block if you're using jQuery.

$(document).ready(function() {
    function someFunction() {
        jQuery.colorbox(
            {
                overlayClose:true,
                href:"/newUI/new.jsp",
                onClosed:removeColor,
                innerHeight:280, 
                scrolling:false
            }
        );
    }
});