Activating a Pop-up from an outside link?

liunx

Guest
I'm looking to make a form of pop-up that appears to a user after arriving at a page from a specific link. Currently the website I'm working on has item description pages for products.

<!-- m --><a class="postlink" href="http://www.mysite.com/itemdesc.asp?ic=productcode">http://www.mysite.com/itemdesc.asp?ic=productcode</a><!-- m -->

I was hoping that by linking to a product that, upon the page loading, they would be presented with a popup of some sort. Now this would be completely dependent on what link they are clicking on. I only want the popup to appear for people that are clicking on the link from a certain source. I barely know enough about ASP to get by, but I was guessing that something like this would be one of the many steps.

<!-- m --><a class="postlink" href="http://www.mysite.com/itemdesc.asp?ic=productcode&popup=1">http://www.mysite.com/itemdesc.asp?ic=p ... de&popup=1</a><!-- m -->

With this I could provide the specialized link only to people that I want to see the special popup that comes up before they view the product page.

For the popup I was hoping to make use of something like this. (<!-- m --><a class="postlink" href="http://www.smashbros.com/en_us/index.html">http://www.smashbros.com/en_us/index.html</a><!-- m -->) I've seen it on many other sites on the net, this page is what I could think of off the top of my head. Click on any of the images in the updates section and you'll see that the image pops up in the same browser window. I haven't done this myself, but I assume it's just some nifty CSS so it's probably no problem to implement.

So in short I want this style of popup to appear upon page load for people that visit a product page with a specific suffix in the url(in order to decide who gets the link and who doesn't.) The whole idea is that the product page shows one price, but special prices are offered to certain customers.

Any and all help will be greatly appreciated. I'm 99% sure this thread is best fit for the ASP forum, but if there's somewhere else I can get more or better help just let me know!

Thanks.Well, if you used PHP then you would do this:
<?php
$ic = @$_GET['ic'];
$popup = @$_GET['popup'];
?>

The variable $ic would contain "productcode" and the variable $popup would then contain the number 1 (?ic=productcode&popup=1)

As for ASP, I stopped using it about 5 years ago as I found out that PHP is much more powerful, but I am sure there is a way to do this too...

Side note: Use Open Source Software! It really is better. ;)That probably is the best way to do the pop-up, saves fighting the pop-up blockers.

The effect you're seeing is lightbox <!-- m --><a class="postlink" href="http://www.huddletogether.com/projects/lightbox/">http://www.huddletogether.com/projects/lightbox/</a><!-- m -->,
also lightbox two <!-- m --><a class="postlink" href="http://www.huddletogether.com/projects/lightbox2/">http://www.huddletogether.com/projects/lightbox2/</a><!-- m -->, as it uses javascript you could just use ASP to write the a call to the javascript function based on the querystring state.


<%
if request.querystring("popup") = "1" then
response.write("<script type=""text/javascript"">popup();</script>")
end if
%>


or the showLightbox(); function in the case of lightbox.Thanks for the reply!

I implemented your suggestions but can't seem to get it to work.

I'm using Lightbox 2 right now, although once I figure it out I'd like to switch to Leightbox (<!-- m --><a class="postlink" href="http://www.eight.nl/files/leightbox/">http://www.eight.nl/files/leightbox/</a><!-- m -->) because it lets me use text. I entered the ASP script just fine. The function for Lightbox 2 is actually initLightbox(); so I made that change.

Upon visiting the page though the popup doesn't automatically load. Here's a link to the test page I'm working with right now. Excuse the awful design, I'm just working with what my company gives me. =p

<!-- m --><a class="postlink" href="http://www.iavi.com/lightbox.asp?ic=pdgdsu20&popup=1">http://www.iavi.com/lightbox.asp?ic=pdgdsu20&popup=1</a><!-- m -->

I'm still using the graphics provided as examples. You can see the image at the top center of the page, next to "Browse other Categories here". I just plopped it in there so I'm almost sure that there's some missing step to this that I completely skipped. Clicking on the image brings up the popup perfectly. I just need it to this on page load instead! In the final version there would have to be no visible link to this popup naturally. So I assume a "display:none" would solve that.

I've clearly missed a step here. Again, any and all help will be greatly appreciated. And big thanks to eddy for your help thus far.


<%
if request.querystring("popup") = "1" then
response.write("<script type=""text/javascript"">initLightbox();</script>")
end if
%>

<link rel="stylesheet" href=http://www.htmlforums.com/archive/index.php/"lightbox.css" type="text/css" media="screen" />
<script src=http://www.htmlforums.com/archive/index.php/"prototype.js" type="text/javascript"></script>
<script src=http://www.htmlforums.com/archive/index.php/"scriptaculous.js?load=effects" type="text/javascript"></script>
<script src=http://www.htmlforums.com/archive/index.php/"lightbox.js" type="text/javascript"></script>


Upon further inspection, it appears that the javascript code is returning an error in Internet Explorer but not Firefox. As best as I can tell anyway.leightbox also uses the lightbox script, it's just been modified, if you want to use leightbox you could also try modalbox.

I'm not sure what changes have been made to the updated lightbox (lightbox2) as I've not been through the scripts, but I'll give it a look soon.

I'll post an example of modalbox for you to take a look at in the meantime.

Zipped File: ## 8671 ##Thanks for that! It's working just like imagined it would. Going to play around with this Modalbox now and see what I can do with it.

Thanks for the help!
 
Back
Top