There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot bsod computer connection cpu crash css dell desktop dma driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware monitor motherboard network networking outlook outlook 2003 outlook 2007 outlook express pio problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
Software Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
HTML - Can someone tell me why this isn't working?


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
asbo's Avatar
Senior Member with 510 posts.
 
Join Date: Sep 2001
Location: who really knows anymore?
Experience: Advanced
25-Jun-2003, 03:22 PM #1
HTML - Can someone tell me why this isn't working?
heya,

The object of this code it to open page htm in a pop up window with nothing but borders and a title bar at a size of 507 x 375 pixels, but when the mouse is over the link, I want the text "This is a link" to cover the user-unfriendly j script void (0) in the status bar, and when the mouse leaves the link the status bar, it needs to go blank again. I sorta kludged this together from some code I have used previous, and such ventures of mine usually don't go so well.

PHP Code:
<A HREF="javascript:void(0)" ONCLICK="window.open('page.htm','page','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=507,height=375" onMouseOver="window.status='This is a link';return true" onMouseOut="window.status='';return true">Link</a>


Here is a demo: <A HREF="javascript:void(0)" ONCLICK="window.open('page.htm','page','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=507,height=375" onMouseOver="window.status='This is a link';return true" onMouseOut="window.status='';return true">Link</a
As you can see, not only does it not open the page, it tries to handle the java script void (0) as a normal. I do not have a very good knowledge of Java Script, so I'm kinda shootin' in the dark. Can anyone clear things up for me?

Thanks,
asbo
__________________
·· ħþø ··
-----
- User Friendly by Illiad -

Last edited by Davey7549 : 26-Jun-2003 05:34 AM.
Shadow2531's Avatar
Distinguished Member with 2,629 posts.
 
Join Date: Apr 2001
25-Jun-2003, 11:09 PM #2
See the attachment. Some of your code had spaces splitting up the middle of the attributes, but the main thing was you forgot the ) at the end of the onclick.


Also, edit your post and remove the demo link. It messed up the code of this page.
Attached Files
File Type: txt newpage.txt (295 Bytes, 52 views)
jay6's Avatar
Junior Member with 6 posts.
 
Join Date: Jun 2003
25-Jun-2003, 11:25 PM #3
Hi
I have done a similar thing without using java script void (0) in the
PHP Code:
 <a href--->

Instead defined function doIt(){
var 
win=window.open("","---","width=X, height=Y, resizable='NO', scrolling='NO'");
}
in <script language="javascript">

instead of  <a href=----->  used <img src="X.gif" alt="This is a link." ONCLICK="doIt()"

Last edited by Davey7549 : 26-Jun-2003 05:19 AM.
jay6's Avatar
Junior Member with 6 posts.
 
Join Date: Jun 2003
25-Jun-2003, 11:30 PM #4
My post got cut the last time.

Hi
I have done a similar thing without using java script void (0) in the <a href--->

Instead defined function
PHP Code:
 doIt(){
var 
win=window.open("","---","width=X, height=Y, resizable='NO', scrolling='NO'");
}
in <script language="javascript">

instead of  <a href=----->  used <img src="X.gif" alt="This is a link." ONCLICK="doIt()"

Last edited by Davey7549 : 26-Jun-2003 05:19 AM.
asbo's Avatar
Senior Member with 510 posts.
 
Join Date: Sep 2001
Location: who really knows anymore?
Experience: Advanced
26-Jun-2003, 12:03 PM #5
OK, Shadow, your code works, but how can I let it have scrollbars when it needs them? I've been messing with it for the last ten mintues, and now I think, perhaps something is contridicting it? Is this the case? What do I do? =/

Jay, your method made absolutely no sense, but maybe thats just me. Thanks for trying though.

And btw, sorry about the link messing things up and stuff.

Thanks,
asbo
__________________
·· ħþø ··
-----
- User Friendly by Illiad -
Shadow2531's Avatar
Distinguished Member with 2,629 posts.
 
Join Date: Apr 2001
27-Jun-2003, 12:52 AM #6
you set the scrollbars to 1.

but the menubar attribute didn't have a value for it so IE was ignoring the scrollbard setting.

it's fixed now.

see attachment.
Attached Files
File Type: txt newpage.txt (296 Bytes, 46 views)
asbo's Avatar
Senior Member with 510 posts.
 
Join Date: Sep 2001
Location: who really knows anymore?
Experience: Advanced
27-Jun-2003, 01:01 AM #7
heya,

Yup, I noticed that right before I checked my e-mail for a response. I think I have things sorted out now . Thanks for all your help guys!!

asbo
Shadow2531's Avatar
Distinguished Member with 2,629 posts.
 
Join Date: Apr 2001
27-Jun-2003, 01:40 AM #8
Jay6's way does work.

I attached an example so you can see how it works.

Just click on the pic and it will open a new window.
No reason to make the pic a link.

It does this by calling a function when the pic is clicked on.

This way can be a lot easier down the road.
Attached Files
File Type: txt otherway.txt (590 Bytes, 43 views)
__________________
10 ? "a line as the unending horizon"
20 ? "a curve as the rolling hillside"
30 ? "a point as a distant bird"
40 ? "a ray as the rising sun"
run

Last edited by Shadow2531 : 27-Jun-2003 01:46 AM.
asbo's Avatar
Senior Member with 510 posts.
 
Join Date: Sep 2001
Location: who really knows anymore?
Experience: Advanced
27-Jun-2003, 01:57 AM #9
heya,

A while after I posted, I looked into using Jay's way, and the only reason I didn't get it cuz normal (non code) stuff in the PHP section. What I tried to do later is make a portable thing of code for uses whenever I need, but .... it didn't work out so well. That aughta occupy me for a while, but we'll see. :-D But now, I do see what Jay meant by his post, but can't use an image for what I'm doing, but I'll log that away somewhere, should I (and I prolly will) need that later. So, again, thanks a bunch guys.

Cya,
asbo
__________________
·· ħþø ··
-----
- User Friendly by Illiad -
jdy's Avatar
jdy jdy is offline
Junior Member with 8 posts.
 
Join Date: Jun 2003
01-Jul-2003, 11:37 AM #10
I am new to all of this so I am not quite sure what I am doing. I want to be able to have the photos thumbnail size on the webpage, but when you click on it, it opens a seperate window this size of the original photo. I gather that the code above does that, but how do I put it in the webiste so that when you click on the thumbnail that actually happens? Right now when I insert that code into the webpage it just says Link, and when you click on that, it then it opens the window. But like I said, I want to be able to just have someone click on the photo itself and have the seperate window open. Help please?
jay6's Avatar
Junior Member with 6 posts.
 
Join Date: Jun 2003
02-Jul-2003, 01:19 AM #11
Hi
<html><head><script language="javascript">
<!--
function Highlight(num){
var img=document.images[num];
var img1="images/Currentimg/PhotoGallery/Ganesha"+num +"SSc.jpg";
var win1=window.open("", "win1","width=290, height=338, resizable='NO',scrolling='NO' alwaysRaised='YES',dependent='YES'");

win1.focus();
win1.document.writeln("<html><head><title>Photo Gallery</title></head><body bgcolor='#CCCC99' bgproperties='fixed' scroll='NO' >");

win1.document.writeln("<div style='position:absolute;left: 0%;top:0%'>");
win1.document.writeln("<img src="+img1+"></div>");
win1.document.writeln("</body></html>");

return true;
}

//-->
</script></head>
<body>
<form>
<input type="image" src="XX.jpg" Alt="XX" onClick="Highlight(1);">

One of the ways to do it.

</body></html>
Reply


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 05:39 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.