473,657 Members | 2,409 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help with multiple scripts on one page....

I have a series of images that, when I click on the thumbnails, I would like to open in a pop-up window fitting the exact size of the image. All the images are either 600x400 wide, or 400x600 tall.... So i created 2 javascript popups, popTall and popWide, so when you click on a wide thumbnail, it accesses popWide, and the tall thumbnails access popTall. The popWide script is first in my code, and it works fine, but the popTall doesnt work at all.... Can you help me with my script so that each one works?! Thanks! Here is the script I'm using in the "HEAD"....

<head>

<SCRIPT LANGUAGE="JavaS cript">
function popWide(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL , '" + id + "', 'toolbar=0,scro llbars=0,locati on=0,statusbar= 0,men
ubar=0,resizabl e=0,width=600,h eight=400,left = 376,top = 135');");
}
// End -->
</script>

<SCRIPT LANGUAGE="JavaS cript">
function popTall(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL , '" + id + "', 'toolbar=0,scro llbars=0,locati on=0,statusbar= 1,men
ubar=0,resizabl e=1,width=400,h eight=600,left = 376,top = 135');");
}
// End -->
</script>

Jul 20 '05 #1
1 1115
"ucsbgaucho " <ch***@chrisaus tin.us> wrote in message
news:6d******** *************** *******@localho st.talkaboutpro gramming.com...
Can you help me with my script so that each one works?!
Thanks! Here is the script I'm using in the "HEAD"....

function popWide(URL) {
day = new Date();
id = day.getTime();
... <snip> ...
function popTall(URL) {
day = new Date();
id = day.getTime();

You're trying to reuse identical variable names on the same page.
Doesn't work. Rename the second scripts variables to "day2" and "id2"
or similar. Then it should work.

-- Richard
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2661
by: Edward King | last post by:
Hi! I am trying to achieve the following: I have a number of help pages (in the format help_nn.php where nn=helpid). I want to be able to open a particular help page by calling the function gethelp(nn) where nn is the helpid. The function is contained in a header file called funcs.inc that each page
0
2796
by: mcp6453 | last post by:
I am trying to use Jack's FormMail script (http://www.dtheatre.com/scripts/formmail). Since I'm brand new at PHP and not very good at HTML, I have an easy question, which I will narrow down. When the email arrives, it has this information: v_firstname: asdf v_lastname: asdf b_email: asdf@bellsouth.net v_phone: asdf v_cellphone: asdf
29
4632
by: Paul | last post by:
Hi, I'd like to limit the number of selections a user can make in a multiple select listbox. I have a note on the interface to say that only x no. of items should be selected and I check the number server side but I'd like to implement some javascript to do the same on the client side. Ideally I'd like the javascript to work in IE5+ and Netscape6+. Thanks,
2
2809
by: kewl | last post by:
Hi All, We have an ASP.NET 2.0 (C#) intranet application that needs to spawn multiple browsers using RegisterClientScriptBlock. Here's what we got so far: // Go thru each datarow in the datatable foreach (System.Data.DataRow drReportGroupsDetails in tableReportGroupsDetails.Rows) { // Get the needed values from the datatable string reportName = (string)drReportGroupsDetails; string reportPath = (string)drReportGroupsDetails;
17
2280
by: Saps | last post by:
Hi all. Can anyone help me here. I have loads of .sql files and i need a way to call these from my asp page so the user can run them from the browser. Meaning i have a page with a list of all scripts. each when clicked i am able to run the script. so HOW and what do i do to call and run the .sql Thanks
1
2386
by: Italian Pete | last post by:
Hi, I have a usercontrol which includes a small piece of Javascript built up as a string in <scripttags and put onto a web page when an instance of the User Control is created. The Javascript does some client side checking of User Input. If I use multiple instances of the same user control on a page, the same block of Javascript is repeatedly written to the page (once for each instance of the user control). Although the user controls...
0
5557
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted ******************************************************** For this teeny job, please refer to: http://feeds.reddit.com/feed/8fu/?o=25
5
3301
by: Max | last post by:
Is there any way to set a select-multiple type <select multiple="multiple"with multiple selected options in scripting? Any idea about this is appreciative.
1
4108
by: Daniel Kaplan | last post by:
I know I can have multiple scripts on one HTML page (at least I think I know I can). i.e. <script language="Javascript" type="text/javascript" src="../js/mainbutts.js"></script> ...html code... ...html code... <script language="Javascript" type="text/javascript"
0
8732
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7330
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6166
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4155
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4306
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1615
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.