Two javascript questions

  ade.h 19:54 20 Sep 2006
Locked

I'm making a gallery need to launch a pop-up window from a group of links on a page (15 in all). Everything is done - gallery html pages, javascript code, etc. - but how do I get the JS code to respond to more than one link? Obviously, they can't use the same ID, but I can't find any info about getting JS to respond classes. There are other links on the page which must not be affected by the JS, so they need to be differentiated in some way.

I would also like to know whether it is possible to change the behaviour of a link based on whether the page is open in the browser itself or in a pop-up window. I have a link that takes visitors back to the thumnails page for use when JS is blocked and the page opens in the browser. I would like the same link to be able to close the pop-up, which would avoid confusion for visitors.

click here for the site (and ignore the duplicated thumbs; just waiting for the last few photos!)

  ade.h 15:17 22 Sep 2006

No JS experts then?

Well, not to worry. I've reworked it to open the gallery in the existing window, without any JS. In a way, I am happier with that from an accessibility viewpoint.

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

Best phone camera 2017

Stunning new film posters by Hattie Stewart, Joe Cruz & more

iPad Pro 10.5in (2017) review

28 astuces pour profiter au mieux de votre iPhone