Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling Sveta. swap text in layers 1

Status
Not open for further replies.

boyfromoz

Technical User
Feb 1, 2001
469
0
0
AU
Well, since no-one else ahd responded to this same request made last month, and since Sveta has helped me in every other one I figure I'd come right out and request the Sveta input.

I have attached a swap text in layer behaviour to a picture. The idea is, when the user rolls over the picture, the text relevant for that picture appears in a different layer. The text that appears on this layer however, is plain black as I can't work out how to attach a style sheet to it.

Can I apply style sheets to this text? If so, how? I need to attach a paragraph and header style sheet.

Nippi
 
Hello nippi!

I've changed name - now I'm Eugene Paliev.

Is your problem still actual? I haven't visited forum for a couple of days and haven't seen your message before...

Good Luck!
 
Hi nippi!

Sorry for delay - I was out of Internet connection...

So I tried to do what you need and I may say that you can use CSS in layer the same as you use it elsewhere.

inside your layer (<layer>, <div> or its combination):
<span style=&quot;color: red; font-size: 200%; font-style: bold&quot;>some text</span>
or
<h1 class=&quot;some_CSS_class&quot;>some text</h1>
or
<p style=&quot;color: green&quot;>some text again</p>

I'm sure that you know how to use CSS, but I found this link (CSS and HTML forum) helpful
thread215-113187 hope that I understood you right, if not let me know.

Good Luck!
 
Ta Eugene, I got that far, but it didn't solve my problem.

I can apply a single style to the whole layer. But I needed to apply a H1 to part of the text, and a p style to the rest. I couldn't(can't) figure out how to apply different styles to two different parts of the swapped text.

I eventually put the H! stuff into a second layer and ended up having a tollover swap text in two different layers which is code heavy.

How do I apply different styles to different parts of the swapping text?


Nippi
 
Here is the code from my example:

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
<script language=&quot;JavaScript&quot;>
<!--
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName==&quot;Netscape&quot;)&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->

function MM_findObj(n, d) { //v4.0
var p,i,x; if(!d) d=document; if((p=n.indexOf(&quot;?&quot;))>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[n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document);
if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_showHideLayers() { //v3.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
obj.visibility=v; }
}
//-->
</script>
</head>

<body bgcolor=&quot;#FFFFFF&quot; text=&quot;#000000&quot;>
<a href=&quot;javascript:;&quot; onMouseOver=&quot;MM_showHideLayers('Layer1','','show')&quot; onMouseOut=&quot;MM_showHideLayers('Layer1','','hide')&quot;><img src=&quot;night_sky.jpg&quot; width=&quot;120&quot; border=&quot;0&quot;></a>
<div id=&quot;Layer1&quot; style=&quot;position:absolute; width:569px; height:47px; z-index:1; left: 254px; top: 55px; visibility: hidden&quot;>
<h1 style=&quot;color: red; font-style: bold; font-size: 200%&quot;>GREATE !!!</h1>
<p style=&quot;color: green; font-style: italic; font-size: 80%; font-family: arial&quot;>and even more...<br>
for those who love life!</p>

</div>
</body>
</html>


Does it help?
 
Much thanks.

This is of great help.

I can't write code but like a monkey I can imitate.

 
I hope I really helped you!

But didn't understand the joke about monkey. Am I monkey?

 
Harhar

No! I'm the monkey. I'm the one imitating your code, as opposed to being a human and writing my own. I still haven't got it to work yet but am working on it.

I'll have a muck about with it can get back to you.


Ta
 
I am a Web Designer and quite new to Dreamweaver. Just went throught the trial version. Had a lot of questions after that. But reading all this has already started to help me. Great question.
 
Hi Eugene.

Your advice didn't work in the end. Your advice only appleid to two different syles within a layer, that layer being made visible/hidden by a rollover.

I'm not trying to make a layer visible or not, I am trying to swap the text in it, and apply two different styles to different parts of the swapping text.

Hide layers andswap text of layers work differently and this method is not applciable, or at least I can't see how to do it.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top