HighDots Forums  

Rollovers and inc files

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss Rollovers and inc files in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Bill
 
Posts: n/a

Default Rollovers and inc files - 01-13-2004 , 04:00 AM






Can i put rollover images onto inc files as i cant seem to get it to change
on mouseover???

Thanks

Bill



Reply With Quote
  #2  
Old   
Murray *TMM*
 
Posts: n/a

Default Re: Rollovers and inc files - 01-13-2004 , 07:35 AM






You can have an include file that contains images which will rollover when
they are included in the receiving page.

But the universe of possible errors you could have made is just too large
for me to hazard a guess. Can you show me the code in the include and the
code in the receiving page?

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver MX
(If you *MUST* email me, don't LAUGH when you do so!)
==================
news://forums.macromedia.com/macromedia.dreamweaver - THE BEST WAY TO GET
ANSWERS
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================

"Bill" <BillBluart (AT) hotmail (DOT) com> wrote

Quote:
Can i put rollover images onto inc files as i cant seem to get it to
change
on mouseover???

Thanks

Bill





Reply With Quote
  #3  
Old   
Bill
 
Posts: n/a

Default Re: Rollovers and inc files - 01-14-2004 , 06:55 AM



OK here is my include, its a search form with a rollover submit button...



-----------------------------------------
<link href="../CSS/STYLES.CSS" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)
x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length;
i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document;
if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++)
x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++)
x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array;
for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc)
x.oSrc=x.src; x.src=a[i+2];}
}

function MM_callJS(jsStr) { //v2.0
return eval(jsStr)
}
//-->
</script>
<body onLoad="MM_preloadImages('/images/BUTTONS/Search_Down.gif')"><form
action="/shipbroking/vesselweb/search/resultlisting.asp" method="post"
name="Search_Vesselweb" id="Search_Vesselweb">
<table width="100%" border="0" cellspacing="0" cellpadding="2">
<tr class="BodyHeadingsTXT">
<td><span class="BodyHeadingsTXT"><strong><em>Search
Vessels</em></strong></span></td>
<td width="1%"><a href="javascript:"
onmouseover="doTooltip(event,tipSearchEntireSite)"
onmouseout="hideTip()"><img src="/images/PICS/roundQ_wbg.gif" width="15"
height="15" border="0"></a></td>
</tr>
</table>
<p>This form searches vessel names and ex-names or call sign, <a
href="#">click here</a> to visit the advanced search pages.</p>
<table width="100%" border="0" cellpadding="2" cellspacing="0">
<tr>
<td width="1%" nowrap><div align="center"> <span
class="LargeBodyTXT"><strong>Vessel Search:</strong> <strong
class="LargeBodyTXT"> </strong></span></div></td>
<td width="99%" nowrap><span class="BodyHeadingsTXT"><strong>
</strong></span>
<input type="text" name="VessSearchfrm" value=""> <a
href="javascript:" onmouseover="doTooltip(event,tipSearchKeywords)"
onmouseout="hideTip()"><img src="/images/PICS/roundQ_wbg.gif" width="15"
height="15" border="0"></a></td>
</tr>
<tr>
<td width="1%"><div align="center"> </div></td>
<td width="99%"> <a href="javascript:"
onClick="MM_callJS('document.Search_Vesselweb.subm it()')"
onMouseOver="MM_swapImage('Image3','','/images/BUTTONS/Search_Down.gif',1)"
onMouseOut="MM_swapImgRestore()"><img src="/images/BUTTONS/Search_Up.gif"
alt="Search" name="Image3" border="0"></a> <input
name="VesselwebQuery1" type="hidden" id="VesselwebQuery12"
value="VesselwebQuery1"> </td>
</tr>
</table>
</form>
<div align="center">
<p>[ <a href="#">ADV SEARCH</a> ]</p>
</div>

My parent page is too big for here but this is the bit that the include is
included

<tr>
<td width="10"
class="ContTablesVertBarLeft">&nbsp;</td>
<td valign="top"
class="LargeBodyTXT"><!--#include
file="../../incs/Search_Vesselweb.asp" --></td>
<td width="11"
class="ContTablesVertBarRight">&nbsp;</td>
</tr>
All the javascript functions are on the include!

The only thing i can see to try next is move the javascript functions onto
my parent page?????

Many Thanks

Bill



"Murray *TMM*" <forums (AT) HAHAgreat-web-sights (DOT) com> wrote

Quote:
You can have an include file that contains images which will rollover when
they are included in the receiving page.

But the universe of possible errors you could have made is just too large
for me to hazard a guess. Can you show me the code in the include and the
code in the receiving page?

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver MX
(If you *MUST* email me, don't LAUGH when you do so!)
==================
news://forums.macromedia.com/macromedia.dreamweaver - THE BEST WAY TO GET
ANSWERS
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================

"Bill" <BillBluart (AT) hotmail (DOT) com> wrote in message
news:bu0cc7$160$1 (AT) forums (DOT) macromedia.com...
Can i put rollover images onto inc files as i cant seem to get it to
change
on mouseover???

Thanks

Bill








Reply With Quote
  #4  
Old   
Murray *TMM*
 
Posts: n/a

Default Re: Rollovers and inc files - 01-14-2004 , 07:23 AM



Bill:

Your include file contains a <body> tag. If the receiving page also
contains one, then DW will be pretty jiggy about working with this. In
addition, the include contains a chunk of javascript. It is usually much
better to work with includes that do not contain 'mixed-region' content,
i.e., head and body code.

Also, consider doing this (it will eliminate one function declaration from
your page) -

<a href="javascript:"
onClick="MM_callJS('document.Search_Vesselweb.subm it()')"

instead of this -

<a href="javascript:this.submit()"

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver MX
(If you *MUST* email me, don't LAUGH when you do so!)
==================
news://forums.macromedia.com/macromedia.dreamweaver - THE BEST WAY TO GET
ANSWERS
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================

"Bill" <BillBluart (AT) hotmail (DOT) com> wrote

Quote:
OK here is my include, its a search form with a rollover submit button...



-----------------------------------------
link href="../CSS/STYLES.CSS" rel="stylesheet" type="text/css"
script language="JavaScript" type="text/JavaScript"
!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)
x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0;
i<a.length;
i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image;
d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document;
if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++)
x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++)
x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array;
for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc)
x.oSrc=x.src; x.src=a[i+2];}
}

function MM_callJS(jsStr) { //v2.0
return eval(jsStr)
}
//--
/script
body onLoad="MM_preloadImages('/images/BUTTONS/Search_Down.gif')"><form
action="/shipbroking/vesselweb/search/resultlisting.asp" method="post"
name="Search_Vesselweb" id="Search_Vesselweb"
table width="100%" border="0" cellspacing="0" cellpadding="2"
tr class="BodyHeadingsTXT"
td><span class="BodyHeadingsTXT"><strong><em>Search
Vessels</em></strong></span></td
td width="1%"><a href="javascript:"
onmouseover="doTooltip(event,tipSearchEntireSite)"
onmouseout="hideTip()"><img src="/images/PICS/roundQ_wbg.gif" width="15"
height="15" border="0"></a></td
/tr
/table
p>This form searches vessel names and ex-names or call sign, <a
href="#">click here</a> to visit the advanced search pages.</p
table width="100%" border="0" cellpadding="2" cellspacing="0"
tr
td width="1%" nowrap><div align="center"> <span
class="LargeBodyTXT"><strong>Vessel Search:</strong> <strong
class="LargeBodyTXT"> </strong></span></div></td
td width="99%" nowrap><span class="BodyHeadingsTXT"><strong
/strong></span
input type="text" name="VessSearchfrm" value=""> <a
href="javascript:" onmouseover="doTooltip(event,tipSearchKeywords)"
onmouseout="hideTip()"><img src="/images/PICS/roundQ_wbg.gif" width="15"
height="15" border="0"></a></td
/tr
tr
td width="1%"><div align="center"> </div></td
td width="99%"> <a href="javascript:"
onClick="MM_callJS('document.Search_Vesselweb.subm it()')"

onMouseOver="MM_swapImage('Image3','','/images/BUTTONS/Search_Down.gif',1)"
onMouseOut="MM_swapImgRestore()"><img src="/images/BUTTONS/Search_Up.gif"
alt="Search" name="Image3" border="0"></a> <input
name="VesselwebQuery1" type="hidden" id="VesselwebQuery12"
value="VesselwebQuery1"> </td
/tr
/table
/form
div align="center"
p>[ <a href="#">ADV SEARCH</a> ]</p
/div

My parent page is too big for here but this is the bit that the include is
included

tr
td width="10"
class="ContTablesVertBarLeft">&nbsp;</td
td valign="top"
class="LargeBodyTXT"><!--#include
file="../../incs/Search_Vesselweb.asp" --></td
td width="11"
class="ContTablesVertBarRight">&nbsp;</td
/tr
All the javascript functions are on the include!

The only thing i can see to try next is move the javascript functions onto
my parent page?????

Many Thanks

Bill



"Murray *TMM*" <forums (AT) HAHAgreat-web-sights (DOT) com> wrote in message
news:bu0opj$i7k$1 (AT) forums (DOT) macromedia.com...
You can have an include file that contains images which will rollover
when
they are included in the receiving page.

But the universe of possible errors you could have made is just too
large
for me to hazard a guess. Can you show me the code in the include and
the
code in the receiving page?

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver MX
(If you *MUST* email me, don't LAUGH when you do so!)
==================
news://forums.macromedia.com/macromedia.dreamweaver - THE BEST WAY TO
GET
ANSWERS
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================

"Bill" <BillBluart (AT) hotmail (DOT) com> wrote in message
news:bu0cc7$160$1 (AT) forums (DOT) macromedia.com...
Can i put rollover images onto inc files as i cant seem to get it to
change
on mouseover???

Thanks

Bill










Reply With Quote
  #5  
Old   
Bill
 
Posts: n/a

Default Re: Rollovers and inc files - 01-14-2004 , 07:41 AM



Hi Murry,

The body tag must have been added when i created the rollovers as i didant
put it there

Quote:
In addition, the include contains a chunk of javascript.
Should i put it all on the parent page?, although i wanted to be able to
include it on any page without having to do extra coding???

Quote:
Also, consider doing this (it will eliminate one function declaration from
your page)
Its already like that? isnt it?

Many thanks for your help

Bill


"Murray *TMM*" <forums (AT) HAHAgreat-web-sights (DOT) com> wrote

Quote:
Bill:

Your include file contains a <body> tag. If the receiving page also
contains one, then DW will be pretty jiggy about working with this. In
addition, the include contains a chunk of javascript. It is usually much
better to work with includes that do not contain 'mixed-region' content,
i.e., head and body code.

Also, consider doing this (it will eliminate one function declaration from
your page) -

a href="javascript:"
onClick="MM_callJS('document.Search_Vesselweb.subm it()')"

instead of this -

a href="javascript:this.submit()"

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver MX
(If you *MUST* email me, don't LAUGH when you do so!)
==================
news://forums.macromedia.com/macromedia.dreamweaver - THE BEST WAY TO GET
ANSWERS
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================

"Bill" <BillBluart (AT) hotmail (DOT) com> wrote in message
news:bu3avo$7fq$2 (AT) forums (DOT) macromedia.com...
OK here is my include, its a search form with a rollover submit
button...



-----------------------------------------
link href="../CSS/STYLES.CSS" rel="stylesheet" type="text/css"
script language="JavaScript" type="text/JavaScript"
!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)
x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0;
i<a.length;
i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image;
d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document;
if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++)
x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++)
x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array;
for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc)
x.oSrc=x.src; x.src=a[i+2];}
}

function MM_callJS(jsStr) { //v2.0
return eval(jsStr)
}
//--
/script
body onLoad="MM_preloadImages('/images/BUTTONS/Search_Down.gif')"><form
action="/shipbroking/vesselweb/search/resultlisting.asp" method="post"
name="Search_Vesselweb" id="Search_Vesselweb"
table width="100%" border="0" cellspacing="0" cellpadding="2"
tr class="BodyHeadingsTXT"
td><span class="BodyHeadingsTXT"><strong><em>Search
Vessels</em></strong></span></td
td width="1%"><a href="javascript:"
onmouseover="doTooltip(event,tipSearchEntireSite)"
onmouseout="hideTip()"><img src="/images/PICS/roundQ_wbg.gif" width="15"
height="15" border="0"></a></td
/tr
/table
p>This form searches vessel names and ex-names or call sign, <a
href="#">click here</a> to visit the advanced search pages.</p
table width="100%" border="0" cellpadding="2" cellspacing="0"
tr
td width="1%" nowrap><div align="center"> <span
class="LargeBodyTXT"><strong>Vessel Search:</strong> <strong
class="LargeBodyTXT"> </strong></span></div></td
td width="99%" nowrap><span class="BodyHeadingsTXT"><strong
/strong></span
input type="text" name="VessSearchfrm" value=""> <a
href="javascript:" onmouseover="doTooltip(event,tipSearchKeywords)"
onmouseout="hideTip()"><img src="/images/PICS/roundQ_wbg.gif" width="15"
height="15" border="0"></a></td
/tr
tr
td width="1%"><div align="center"> </div></td
td width="99%"> <a href="javascript:"
onClick="MM_callJS('document.Search_Vesselweb.subm it()')"


onMouseOver="MM_swapImage('Image3','','/images/BUTTONS/Search_Down.gif',1)"
onMouseOut="MM_swapImgRestore()"><img
src="/images/BUTTONS/Search_Up.gif"
alt="Search" name="Image3" border="0"></a> <input
name="VesselwebQuery1" type="hidden" id="VesselwebQuery12"
value="VesselwebQuery1"> </td
/tr
/table
/form
div align="center"
p>[ <a href="#">ADV SEARCH</a> ]</p
/div

My parent page is too big for here but this is the bit that the include
is
included

tr
td width="10"
class="ContTablesVertBarLeft">&nbsp;</td
td valign="top"
class="LargeBodyTXT"><!--#include
file="../../incs/Search_Vesselweb.asp" --></td
td width="11"
class="ContTablesVertBarRight">&nbsp;</td
/tr
All the javascript functions are on the include!

The only thing i can see to try next is move the javascript functions
onto
my parent page?????

Many Thanks

Bill



"Murray *TMM*" <forums (AT) HAHAgreat-web-sights (DOT) com> wrote in message
news:bu0opj$i7k$1 (AT) forums (DOT) macromedia.com...
You can have an include file that contains images which will rollover
when
they are included in the receiving page.

But the universe of possible errors you could have made is just too
large
for me to hazard a guess. Can you show me the code in the include and
the
code in the receiving page?

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver MX
(If you *MUST* email me, don't LAUGH when you do so!)
==================
news://forums.macromedia.com/macromedia.dreamweaver - THE BEST WAY TO
GET
ANSWERS
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================

"Bill" <BillBluart (AT) hotmail (DOT) com> wrote in message
news:bu0cc7$160$1 (AT) forums (DOT) macromedia.com...
Can i put rollover images onto inc files as i cant seem to get it to
change
on mouseover???

Thanks

Bill












Reply With Quote
  #6  
Old   
Murray *TMM*
 
Posts: n/a

Default Re: Rollovers and inc files - 01-14-2004 , 07:53 AM



Bill:

Quote:
The body tag must have been added when i created the rollovers as i didant
put it there
Whatever, it shouldn't be there if you want to keep DMX happy.

Quote:
Should i put it all on the parent page?, although i wanted to be able to
include it on any page without having to do extra coding???
The best plan is to build an external js file that contains *all* the js
required by *all* files, and just link to it on each page. This allows the
file to be cached by the browser and removes any bandwidth hit from all
pages as a result (except the first page, of course).

Quote:
Its already like that? isnt it?
No - you are calling the MM_CallJS function which then submits the form, and
I am just submitting the form directly.

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver MX
(If you *MUST* email me, don't LAUGH when you do so!)
==================
news://forums.macromedia.com/macromedia.dreamweaver - THE BEST WAY TO GET
ANSWERS
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================

"Bill" <BillBluart (AT) hotmail (DOT) com> wrote

Quote:
Hi Murry,





Reply With Quote
Reply




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



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.