jQuery Javascript: TopUP

Hi,

i'm using the TopUp http://gettopup.com/ Javascript library for my image gallery. I have been following the documents, and looking at the Demo.

I am having a hard time figuring out how the "onclose" event/function works. Everything else works perfectly.

I have the following <a href="photos/1.jpg" toptions="effect = clip, shaded = 1, onclose = function() {alert('Hello world!');} "><img src="thumbnails/1.jpg"/></a>

But i can't get the "onclose" to work, such as in this demo: http://gettopup.com/demo

Thank you so much if you can assist me on this one.

Regards...
TikkTakk-AiconAsked:
Who is Participating?
 
hieloConnect With a Mentor Commented:
this works:
<html>
  <head>
    <script type="text/javascript" src="http://gettopup.com/releases/latest/top_up-min.js"></script>
  </head>
  <body>
    <div id="examples">
      <a href="http://gettopup.com/examples/2.%20Grouped%20links/photos/by-ben-adamson.jpg"><img src="http://gettopup.com/examples/2.%20Grouped%20links/thumbnails/by-ben-adamson.jpg"/></a>
      <a href="http://gettopup.com/examples/2.%20Grouped%20links/photos/2.jpg"><img src="http://gettopup.com/examples/2.%20Grouped%20links/thumbnails/2.jpg"/></a>
      <a href="http://gettopup.com/examples/2.%20Grouped%20links/photos/3.jpg"><img alt="At Sunset" src="http://gettopup.com/examples/2.%20Grouped%20links/thumbnails/3.jpg"/></a>
    </div>
    
   <script type="text/javascript">
      TopUp.addPresets({
        "#examples a": {
          title: "Gallery {alt} ({current} of {total})",
          group: "examples",
          readAltText: 1,
          shaded: 1,
		onclose:function(){alert('hi')}
        }
      });
    </script>

      </body>
</html>

Open in new window

0
 
hieloCommented:
I've never used that library, but have you tried specifying the name of the function:
<script>
function closer(){
alert('Hello world!');
}
</script>
<a href="photos/1.jpg" toptions="effect = clip, shaded = 1, onclose ='closer' "><img src="thumbnails/1.jpg"/></a>

Open in new window

0
 
hieloCommented:
if that still doesn't work, try without apostrophes around the function name:
toptions="effect = clip, shaded = 1, onclose =closer "
0
 
TikkTakk-AiconAuthor Commented:
Hey,

I tried them all, still not working... Any further Suggestions?.

I appreciate your help..
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.