Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-14-2013, 09:34 PM   PM User | #1
ssreverb
New to the CF scene

 
Join Date: Nov 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
ssreverb is an unknown quantity at this point
Adding custom button and toolbars to PhotoSwipe

I've posted this other places, emailed the developer, and no one has helped... hoping someone here can help.. thanks in advance!!

I'm trying to use this code at the link below to customize Photoswipe so I can have a custom toolbar:
https://github.com/codecomputerlove/...m-toolbar.html

Instead of the sayHiClickHandler function I started to replace it with a needed SEND button which will open up a external link - so that information on the specific project can be mailed directly to a client. This is something that will be used internally on company iPads to present projects to clients.

You can see the site so far here: http://www.digitour360.com/freelon2/indexCUS.html
Keep in mind the layout is designed to fit iPads only right now, not PCs, and each thumbnail will activate a seperate photo gallery.

Note: Click the second thumbnail at the top, it is the only active one right now.

The SEND button works on PCs, but this site is specifically for iPads right now, and when you touch the SEND button nothing happens. How can I fix this?

Also, I need some sort of function that would allow me to have additional toolbars for each gallery, once those are active. You can see that it mentions Gallery2, I want gallery1, gallery3, gallery4, etc to each call different toolbars (getToolbar function has only 1, need additional toolbars for each gallery. I'm a beginner when it comes to javascript, so detailed code on how to accomplish this would be very helpful.

Below is the current code that allows me to add a custom toolbar. Again I need to change this so I can call up different toolbars based on which gallery they are in, as well as, fix the issue with the SEND link not working.

Code:
<script type="text/javascript">

(function(window, Util, PhotoSwipe){

document.addEventListener('DOMContentLoaded', function(){

options = {

getToolbar: function(){
return '<div class="ps-toolbar-close" style="padding-top: 12px;">Close</div><div class="ps-toolbar-play" style="padding-top: 12px;">Play</div><div class="ps-toolbar-previous" style="padding-top: 12px;">Previous</div><div class="ps-toolbar-next" style="padding-top: 12px;">Next</div><a onclick="open_win()" style="padding-top: 12px;cursor:pointer">Send</a></div>';
// NB. Calling PhotoSwipe.Toolbar.getToolbar() wil return the default toolbar HTML
}

},
instance = PhotoSwipe.attach( window.document.querySelectorAll('#Gallery2 a'), options );



});


}(window, window.Code.Util, window.Code.PhotoSwipe));

</script>
ssreverb is offline   Reply With Quote
Old 02-15-2013, 08:36 PM   PM User | #2
sunfighter
Senior Coder

 
Join Date: Jan 2011
Location: Missouri
Posts: 2,491
Thanks: 18
Thanked 361 Times in 360 Posts
sunfighter is on a distinguished road
Since PhotoSwipe is for Mobile and Touch devices why not post to the section on mobile devices http://www.codingforums.com/forumdisplay.php?f=70

But when the person that made the app can't or wont help, what chance do any of us have?
sunfighter is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:32 AM.


Advertisement
Log in to turn off these ads.