User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 329,147 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,703 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 1431 | Replies: 4
Reply
Join Date: Mar 2005
Posts: 14
Reputation: venetian_jigsaw is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
venetian_jigsaw venetian_jigsaw is offline Offline
Newbie Poster

Help Pop-up attribute question

  #1  
Nov 11th, 2005
I am unable to get my pop-up to resize or hide the toolbar when I select a thumbnail. I entered the width & height in my onclick event, bu that did not seem to work. I am guessing that I probably need to enter the attributes in the function and if so, where do they go?

Thanks for any assistance that you can provide!

<script type="text/javascript">
function openWindow(modelnum)
{
prodWindow=window.open("lgImg.php?modelnum="+modelnum+"","null");
prodWindow.focus();
}
</script>

<?php
while ($myrow = mysql_fetch_array($myresult))
{
?>
<tr>
<td><a href='#' onclick='openWindow("<?php echo $myrow['modelnum']; ?>")'><img src='../images/products/<?php echo $myrow ["imgsm"]; ?>' border='0' /></td>
<?php
}
?>
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2004
Posts: 1,589
Reputation: tgreer is an unknown quantity at this point 
Rep Power: 7
Solved Threads: 33
Colleague
tgreer tgreer is offline Offline
Made Her Cry

Re: Pop-up attribute question

  #2  
Nov 11th, 2005
The arguments to the window.open() function are: URL, Name, and Features.

URL is self-evident. Name is the name of the opened window, which can be used as an argument for the target attribute of hyperlinks.

Features is an optional list of characteristics of the new window:

For example:

<a href="myimage.gif" 
  onClick="window.open('myimage.gif', 'myWin', 
  'toolbar=no, directories=no, location=no, 
  status=yes, menubar=no, resizable=no, scrollbars=no, 
  width=300, height=200');">my image</a>

Reply With Quote  
Join Date: Mar 2005
Posts: 14
Reputation: venetian_jigsaw is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
venetian_jigsaw venetian_jigsaw is offline Offline
Newbie Poster

Re: Pop-up attribute question

  #3  
Nov 11th, 2005
Thomas,

I am a little confused: this works only if you are calling a single img on a single page and not multiple img's from a single page (e.g. a catalog). Since multiple img's are called from the db, I wrote a function that would grab the img tied to the modelnum, hence my function is executed in the onclick event. So, do I include the attributes in the function or in the event?

Thanks
Reply With Quote  
Join Date: Dec 2004
Posts: 1,589
Reputation: tgreer is an unknown quantity at this point 
Rep Power: 7
Solved Threads: 33
Colleague
tgreer tgreer is offline Offline
Made Her Cry

Re: Pop-up attribute question

  #4  
Nov 11th, 2005
Your question, as I understood it, was how to remove the toolbar from your opened window. My response was to show you that the window.open() function has an optional "features" parameter to control this.

You need to change this line in your code:

prodWindow=window.open("lgImg.php?modelnum="+modelnum+"","null");

You are passing in "null" as a name, and leaving off the the feature string. Edit it to pass in the features you desire for the pop-up window.
Reply With Quote  
Join Date: Mar 2005
Posts: 14
Reputation: venetian_jigsaw is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
venetian_jigsaw venetian_jigsaw is offline Offline
Newbie Poster

Re: Pop-up attribute question

  #5  
Nov 11th, 2005
Thanks Thomas...that seems to have doe the trick!
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb Marketplace (Sponsored Links)
Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 8:41 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC