Contact Us Forum Rules Search Archive
WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-05-2005, 09:36 AM
WebProWorld Member
 

Join Date: Sep 2004
Location: The Garden of England
Posts: 62
whats going on RepRank 0
Default Title on popup!

My website has links to pop up a new window with a image.
It shows the title of the image that I have put in,, but before my title is shows the URL ie: http://www.whatsgoingon.me.uk

If the image is not wide enough, the title can not be seen because the URL has taken up all the space!

How do I stop it from showing the URL??

Help and thanks.....

Do I need to change something here:

// Script Source: CodeLifter.com
// Copyright 2003
// Do not remove this notice.

// SETUPS:
// ===============================

// Set the horizontal and vertical position for the popup

PositionX = 100;
PositionY = 100;

// Set these value approximately 20 pixels greater than the
// size of the largest image to be used (needed for Netscape)

defaultWidth = 500;
defaultHeight = 500;

// Set autoclose true to have the window close automatically
// Set autoclose false to allow multiple popup windows

var AutoClose = true;

// Do not edit below this line...
// ================================
if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+defaultWidth+',height ='+defaultHeight+',left='+PositionX+',top='+Positi onY;
var optIE='scrollbars=no,width=150,height=100,left='+P ositionX+',top='+PositionY;
function popImage(imageURL,imageTitle){
if (isNN){imgWin=window.open('about:blank','',optNN); }
if (isIE){imgWin=window.open('about:blank','',optIE); }
with (imgWin.document){
writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0; ');writeln('isIE=(navigator.appName.indexOf("Micro soft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
writeln('width=100-(document.body.clientWidth-document.images[0].width);');
writeln('height=100-(document.body.clientHeight-document.images[0].height);');
writeln('window.resizeTo(width,height);}');writeln ('if (isNN){');
writeln('window.innerWidth=document.images["George"].width;');writeln('window.innerHeight=document.ima ges["George"].height;}}');
writeln('function doTitle(){document.title="'+imageTitle+'";}');writ eln('</sc'+'ript>');
if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
else writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
writeln('[img]+imageURL+[/img]</body></html>');
close();
}}

</script>
__________________
Whats Going On
Reply With Quote
  #2 (permalink)  
Old 02-09-2005, 12:46 PM
Faglork's Avatar
WebProWorld Veteran
 

Join Date: Feb 2005
Location: Forchheim, Germany
Posts: 947
Faglork RepRank 0
Default

It works perfectly in FireFox. What Browser / Version do you use?

Alex
Reply With Quote
  #3 (permalink)  
Old 02-09-2005, 01:37 PM
paulhiles's Avatar
WebProWorld 1,000+ Club
 

Join Date: Jul 2003
Location: UK
Posts: 2,803
paulhiles RepRank 0
Default Working fine in Firefox 1.0 and IE 6

Works fine in both Firefox 1.0 and IE 6 as far as I can see.
Do you have a particular page or link that's misbehaving?

Paul
Reply With Quote
  #4 (permalink)  
Old 02-10-2005, 07:25 AM
WebProWorld Member
 

Join Date: Sep 2004
Location: The Garden of England
Posts: 62
whats going on RepRank 0
Default

Hi,

On the October page,, if you look at Saturday 25 Oct,, The first link on thet day is "moat"
This is portrait rather than landscape,, you should have an image of children and birds.

The title is pushed out of the way because the website address is hogging all the space!!!

I'm using IE6

It is only a problem on portrait images!

Can I stop the website address from being displayed??

Thanks
__________________
Whats Going On
Reply With Quote
  #5 (permalink)  
Old 02-10-2005, 09:35 AM
paulhiles's Avatar
WebProWorld 1,000+ Club
 

Join Date: Jul 2003
Location: UK
Posts: 2,803
paulhiles RepRank 0
Default Terminology

I tried the specific link you describe.
The "title" displayed perfectly fine (again) on both IE6 and Firefox.
Are you sure you mean the site title is being squashed?
It is possible you're using a browser that has a particularly long user agent string in the browser title bar? Often if a system uses browser software supplied by an ISP (for example), they'll add their own custom title tag. So you'll get something like "Microsoft Internet Explorer provided by XYZ Limited"
This could be what is causing the problem when viewing narrow images.

Paul
Reply With Quote
  #6 (permalink)  
Old 02-11-2005, 08:45 AM
WebProWorld Member
 

Join Date: Sep 2004
Location: The Garden of England
Posts: 62
whats going on RepRank 0
Default

I've put a prt scr image on the site so you can see exactly what I'm seeing
http://www.whatsgoingon.me.uk/photos...gone_wrong.jpg

The picture title should be: "children playing by the moat"

Instead all I have is "Chil..."

If I could stop it from displaying the website address then there would be enough room for the title.

Help!!!
__________________
Whats Going On
Reply With Quote
  #7 (permalink)  
Old 02-11-2005, 09:01 AM
paulhiles's Avatar
WebProWorld 1,000+ Club
 

Join Date: Jul 2003
Location: UK
Posts: 2,803
paulhiles RepRank 0
Default Ah.....

I really don't know why you're seeing that! :o)

I can see it for myself on your screengrab, but when I'm viewing the popups on your site I'm not seeing the site address at all, I just see the title of the picture, then if there's room I'll see the user agent of the particular browser I'm using.

Can anyone else see the site address before the image title?

Paul
Reply With Quote
  #8 (permalink)  
Old 02-11-2005, 11:01 AM
WebProWorld Veteran
 

Join Date: Nov 2003
Location: Castle Rock, CO
Posts: 494
Corey Bryant RepRank 0
Default

I am seeing what Paul see, but I think I know your problem - the Javascript. You are adding the title tag.

You might have to consider adding the photo to an HTML page to have the "correct" title. What OS are you using?
Reply With Quote
  #9 (permalink)  
Old 02-11-2005, 04:41 PM
WebProWorld Member
 

Join Date: Sep 2004
Location: The Garden of England
Posts: 62
whats going on RepRank 0
Default

How weird,, I wondered why I wasn't making sence!!!

I'm using XP Pro, IE6 SP2

Are you guys running XP Pro and IE6??

I received an e-mail from someone as below offering a solution but hasn't made any difference!!!

Should it have???

Hi andy,

i was looking for help in forums and came across your question somewhere.. no idea where.. but i seem to have found a solution for you.

Stage one: Cut out the following from the page(s)

<script>

// Script Source: CodeLifter.com
// Copyright 2003
// Do not remove this notice.

// SETUPS:
// ===============================

// Set the horizontal and vertical position for the popup

PositionX = 50;
PositionY = 50;

// Set these value approximately 20 pixels greater than the
// size of the largest image to be used (needed for Netscape)

defaultWidth = 600;
defaultHeight = 600;

// Set autoclose true to have the window close automatically
// Set autoclose false to allow multiple popup windows

var AutoClose = true;

// Do not edit below this line...
// ================================
if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+defaultWidth+',height ='+defaultHeight+',left='+PositionX+',top='+Positi onY;
var optIE='scrollbars=no,width=150,height=100,left='+P ositionX+',top='+PositionY;
function popImage(imageURL,imageTitle){
if (isNN){imgWin=window.open('about:blank','',optNN); }
if (isIE){imgWin=window.open('about:blank','',optIE); }
with (imgWin.document){
writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0; ');writeln('isIE=(navigator.appName.indexOf("Micro soft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
writeln('width=100-(document.body.clientWidth-document.images[0].width);');
writeln('height=100-(document.body.clientHeight-document.images[0].height);');
writeln('window.resizeTo(width,height);}');writeln ('if (isNN){');
writeln('window.innerWidth=document.images["George"].width;');writeln('window.innerHeight=document.ima ges["George"].height;}}');
writeln('function doTitle(){document.title="'+imageTitle+'";}');writ eln('</sc'+'ript>');
if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
else writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
writeln('[img]+imageURL+[/img]</body></html>');
close();
}}

</script>


Stage 2 : Replace it with

<script language="JavaScript" src="../popup.js" type="text/javascript"></script>


Stage 3: start notepad and copy the following into it.

// Script Source: CodeLifter.com
// Copyright 2003
// Do not remove this notice.

// SETUPS:
// ===============================

// Set the horizontal and vertical position for the popup

PositionX = 50;
PositionY = 50;

// Set these value approximately 20 pixels greater than the
// size of the largest image to be used (needed for Netscape)

defaultWidth = 600;
defaultHeight = 600;

// Set autoclose true to have the window close automatically
// Set autoclose false to allow multiple popup windows

var AutoClose = true;

// Do not edit below this line...
// ================================
if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+defaultWidth+',height ='+defaultHeight+',left='+PositionX+',top='+Positi onY;
var optIE='scrollbars=no,width=150,height=100,left='+P ositionX+',top='+PositionY;
function popImage(imageURL,imageTitle){
if (isNN){imgWin=window.open('about:blank','',optNN); }
if (isIE){imgWin=window.open('about:blank','',optIE); }
with (imgWin.document){
writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0; ');writeln('isIE=(navigator.appName.indexOf("Micro soft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
writeln('width=100-(document.body.clientWidth-document.images[0].width);');
writeln('height=100-(document.body.clientHeight-document.images[0].height);');
writeln('window.resizeTo(width,height);}');writeln ('if (isNN){');
writeln('window.innerWidth=document.images["George"].width;');writeln('window.innerHeight=document.ima ges["George"].height;}}');
writeln('function doTitle(){document.title="'+imageTitle+'";}');writ eln('</sc'+'ript>');
if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
else writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
writeln('[img]+imageURL+[/img]</body></html>');
close();
}}
Save it as popup.js

Stage 4: Upload the changed october page
Stage 5: Upload popup.js to the root directory of your site. (You can put it elsewhere too but Location must match the link in Stage 2, so dont forget to change it there too!)


Its the same script - yet saved externally and "called in" seems to make the difference. The pop ups show up like you want them to. Another advantage: you dont need to have the script on every page, you can have it just one time as an external file and call for it from all pages where it is needed. That saves a bit of storage space and somehow accelerates the loading.
__________________
Whats Going On
Reply With Quote
  #10 (permalink)  
Old 02-11-2005, 05:28 PM
WebProWorld Veteran
 

Join Date: Nov 2003
Location: Castle Rock, CO
Posts: 494
Corey Bryant RepRank 0
Default

I know hardly nill about JS< but I am using Windows XP Professional (SP1) and IE 6 (SP2)
Reply With Quote
  #11 (permalink)  
Old 02-18-2005, 01:23 PM
hommealone's Avatar
WebProWorld Pro
 

Join Date: Feb 2004
Location: Kingston, NY USA
Posts: 107
hommealone RepRank 0
Default this involves winxp SP2

Hi. Don't know if this will help, but...

With windowsXP and IE SP2, Microsoft made IE function so that the URL of the page always shows up in the title bar in front of the title of the page. In other words, where the title bar in IE, before SP2 came along, might have read: "[Some title words] - Microsoft Internet Explorer", after SP2 it now reads: "http://www.yourdomainname.com - [Some title words] - Microsoft Internet Explorer". Quite a bar-full!

Microsoft considers this a security feature. Not only is this 'feature' set by default in IE (running under SP2), but there is no option to modify it.

This leaves less room for your title words in a narrow window. But unless you want to change your domain name to something very short ;) you're stuck with having a long domain name taking up room before your title phrase, as far as I know, and there's nothing you can do about it. Bummer!
Reply With Quote
  #12 (permalink)  
Old 02-28-2005, 03:46 PM
WebProWorld Member
 

Join Date: Sep 2004
Location: The Garden of England
Posts: 62
whats going on RepRank 0
Default

Wow,, thank you for your reply...

A shame I can't do anything about it......

.... but saves me looking any further

If any solutions come up in future,, think of me...

Cheers
Andy
__________________
Whats Going On
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Tags: ,



Thread Tools
Display Modes

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

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


Search Engine Optimization by vBSEO 3.2.0