Swipebox – appending description to title
-
Hello,
first of all, love the plugin, cheers for the great work!
I’m using the Swipebox portion of the plugin and displaying titles above the image, but my client has requested image descriptions to be visible as well. Since the plugin only allows you to display one option, I need to work out a custom solution. I figured I’d just append the description onto the title (#swipebox-title) in a new row (and adjust the css of .swipebox-top-bar to be expandable). I looked up Swipebox and found a small javascript that holds the plugins’ options, along with some ways to hook into it, but I’m guessing this plugin has changed the way these are loaded since I can’t get it to work. None of my console.logs are firing. I assume I’d also need to track and reload the description upon slide switch in gallery mode though, and there doesn’t seem to be a hook for that…
This is the script (inside document.ready):
// Swipebox edits $( '.swipebox' ).swipebox( { beforeOpen: function() { console.log("opening swipebox"); //TODO: need to get description value of the clicked item and append it to .swipebox-title as <br><p class="swipebox-description">content</p> }, // called before opening afterOpen: function() { console.log("swipebox opened"); }, // called after opening afterClose: function() { console.log("swipebox closed"); }, // called after closing } );
Any ideas how to get this to work, or if I’m even on the right track? Is there a simpler way to achieve what I need?
Many thanks in advance,
S.
- The topic ‘Swipebox – appending description to title’ is closed to new replies.