Solved

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

Posted on 2013-01-27
5
902 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article discusses four methods for overlaying images in a container on a web page
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…

776 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