javascript - jquerylightbox does not work - is it issue with the script file include sequence? -


i trying use jquery.lighbox library fails find lightbox method.

what did:

include jquery.lightbox.js (immediatly after jquery itself):

<html lang="en">     <head>         <meta charset="utf-8" />         <link href="/content/site.css" rel="stylesheet"/>         <link href="/content/jquery.lightbox.css" rel="stylesheet"/>         <script src="/scripts/modernizr-2.5.3.js"></script>         <script src="/scripts/jquery-1.7.1.js"></script>         <script src="/scripts/jquery.lightbox.js"></script>    ...  <head> 

and within body am wiring lightbox code html elements:

<body> <script type="text/javascript">     $(function () {         try         {             $('#gallery a').lightbox(); // select links lightbox class         }         catch (err) {             var txt = "";             txt = "there error on page.\n\n";             txt += "error description: " + err.message + "\n\n";             txt += "click ok continue.\n\n";             alert(txt);         }     });     </script> 

and quite expectantly js code throws error:

there error on page.error description: object [object object] has no method 'lightbox'click ok continue.

i new jquery, if can give me hint did wrong , how fix it.

thank you.

edit:

resolved : turned out jquery.js has been include twice, , hiding jquery.lightbox function.

object [object object] has no method 'lightbox'

this mean lightbox method not found means lightbox js not loaded properly..check out...view source..and make sure path correct


Comments

Popular posts from this blog

node.js - Bad Request - node js ajax post -

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -