-1

Im having a little trouble trying to implement a plugin on to my site, im pretty new to js and im having a little trouble getting my head around the syntax.. The part im having trouble with bellow is the lines #mm-prev and #mm-next.. Have i added those bits correctly ?

<script type="text/javascript">  
            jQuery(document).ready(function(){  
              jQuery(".jbgallery").jbgallery({
                 fullscreen: false,
                 style : "zoom",
                 randomize : 1,
                 menu : true,
                 slideshow:false,
                 caption : false
              });  

              jQuery("#mm-prev").click(function(){
                   obj.left(); 
              }); 

              jQuery("#mm-next").click(function(){
                  obj.right(); 
              }); 
        });  
</script>

the html those last parts go with is

        <a id="mm-next" href="#">NEXT</a>
        <a id="mm-prev" href="#">PREV</a>

for a bit of background the script in question is JBgallery

4
  • is this the whole of the code - from script to /script ? Commented Dec 3, 2012 at 12:16
  • can you show your divs? #mm-prev and #mm-next should be id's inside your div's e.g. <div id="#mm-prev"></div> Commented Dec 3, 2012 at 12:17
  • 2
    Could you please tell us what the error is? Commented Dec 3, 2012 at 12:18
  • 1
    How's obj defined..my guess is it should be a reference to jQuery(".jbgallery") Commented Dec 3, 2012 at 12:19

1 Answer 1

2

Instead of obj it looks like you should be selecting .jbgallery:

          jQuery("#mm-prev").click(function(){
               jQuery('.jbgallery').left(); 
          }); 

          jQuery("#mm-next").click(function(){
               jQuery('.jbgallery').right(); 
          }); 
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.