PDA

View Full Version : Javascript/transparant background



Laslos
26th Jul 2006, 09:10 AM
Hi, my site is not even close to published yet but I had 2 questions.
1. I would like to know if it is possible to have a transparant image with text over it. I have a background and I have an image in the background but when I try to edit the page, it is showing the image as a seperate element instead as of part of the background. If I try to add text, it will either add it above or below the background image. I thought the background was a seperate layer but either that is not the case, or i did it wrong?

I have also tried to place java script on my page but it does not work, it always comes up with an error. If I put code in just the header, it will work for example, I was just testing some code that disables left clicking on the page. If I try to add in any java to a page, it will not work. The error I get is always the same thing, it says: unterminated string constant line.. char...

The way I am trying to add it is by adding a text element and then pasting the java code in the html part. Does anyone knwo what I may be doing wrong? I have tested the java code on other sites and also on some free java testing sites i found on google and the code worked fine.

Thanks

gatormom17
26th Jul 2006, 10:44 AM
Laslos, I wanted to welcome you, but I am sorry that I cannot answer your questions. even tho I am a mod in this room, I am still learning too. there are others here who may come along and help you.. I really just wanted to say welcome aboard..

why don't you post an intro in the "hello my name is room" so we can get to know you

cameraplus
26th Jul 2006, 11:15 AM
Laslos,
I'm working blind here since you haven't posted a URL for your site, and I don't think anyone can view it until it's been published anyway, but hopefully this'll help to get you going.

Normal HTML doesn't support any sort of layering, though you can specify a background image which is tiled over the whole page in the <body> tag like so:
<body background="locationof/bgimage.jpg">

Everything else will appear on top of this page background image, but all items/elements will be at the same layer/level so they can't/won't overlap.

Using CSS with HTML does allow you to do some fancier things including layering items on the page so they overlap partially or completely.

Also, with CSS, almost any page element can have its own background image, and text placed within an element will appear above the background image for that element.

For instance, the following code will produce a <div> area on the page with a background image, and the text content of the <div> will appear over the image, which sounds like the sort of thing you're trying to achieve:

<div style="background-image: url(/locationof/bgimage.gif)">This text in the DIV appears on top of the background image.</div>

The only other way to place text over images is to prepare the whole thing as an image file using an image editor like Photoshop or Fireworks. This means your text will not be readable by the SE's, although you can add some SE readable text to the image alt tag.

On your Javascript error, make sure you check the Disable Carriage Returns box when you paste anything into a text element in the Storebuilder, otherwise you get a load of extra code added. For Javascript, this typically leads to various errors as it inserts breaks in the JS code in odd places.

Can't say anything more specific without seeing your site - hope you get published soon.

Christine
26th Jul 2006, 01:38 PM
Hi and Welcome
If you received an invitation to join this forum then your site is published. It is the only way I could get your email etc. You may not have a domain name attached to it yet but if you want to view your site live or let us look at it all you need as the URL is:
www.storesonlinepro.com/store/555555 or what ever your licence number is.

If you found us some other way then please let us know cos it is interesting if there are other methods of people to get to know us.