I am using the code below for loading an external page into a lightbox. How could I pass from the href tag, a variable named ‘page’ to the javascript (line 1) containing the value of a page link = ‘country.php’. I am wanting to use this script call several times without having to have additional javascript lines for each link.
<script>
$("a#selector").live("click", function(){$(".overlayInner").load("/country.php"); })
$("a#selector").live("click", function(){$(".overlayOuter").fadeIn(300); })
$("a#selector").live("click", function(){$(".overlayInner").fadeIn(500); })
$("a#selector").live("click", function(){$(".closepop").fadeIn(500); })
</script>
<a id="selector" href="#"><img src="/images/somegraphic.gif"></a>
Any help is much appreciated.
Try this:
If you want to get the inner text that says “Country”, or an image you can do: