Solved

Can I get Photoswipe (jquery) to open a full web page?

Posted on 2013-01-27
5
901 Views
Last Modified: 2013-01-28
Hi -

I'm using a very excellent photo gallery jQuery plug in called Photoswipe.

My test page is linked here.  

On the sample page you will see 4 photo thumbnails and 3 numbered ones.  If you click on a photo thum you see the Pswipe slide show gallery interface.

Is there a way to click on a thum and go to a completely different web page - not a photo in a gallery - not the slide show interface?

If so - is there an expert who can show me how to do that?

TIA
d2
0
Comment
Question by:dzash2000
  • 3
  • 2
5 Comments
 
LVL 11

Expert Comment

by:mcnute
ID: 38826061
If you have your links hardcoded than it is easy to make them behave like normal links like so:

<a href="http://example.com/affiliate" target="_blank"> 
   <img class="seeMe"  
		src="_img/barga/-thums/thum-BA-01a.jpg" 
      alt="In Barga we stayed at the Alpino Hotel.  
      A nice place on a main street." 
		data-photo-type="close" />  
</a>
 

Open in new window


What I've done here is I changed the href attribute to link it to your external site. The photoswipe plugin recognizes your image links by one of these classes "close all isotope-item". I simply removed all of them and the photoswipe wouldn't trigger on them.

Hope that helped you.
mcnute
0
 

Author Comment

by:dzash2000
ID: 38826638
mcnute -
thanks for the reply.  That's what I thought but it still opens the gallery type black screen with the slideshow controls and an X in the middle.  It's still looking for an image.
0
 

Author Comment

by:dzash2000
ID: 38826654
mcnute - even if I pare it down to bare link - it still opens inside the gallery interface.  

	
 <a href="http://www.cnn.com" target="_blank"> 
   <img src="_img/barga/-thums/thum-BA-01a.jpg"  />  
</a>

Open in new window

0
 
LVL 11

Accepted Solution

by:
mcnute earned 500 total points
ID: 38826678
if you want just to go to another site, then make the thumb being outside of the photoswipe container element.

If you want to open iframes with vidoes or entire websites you'll need another plugin, which is http://www.shadowbox-js.com/
0
 

Author Closing Comment

by:dzash2000
ID: 38826749
I see what you mean.  Thanks for the tip.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now