?
Solved

Using variable to select background image in div

Posted on 2006-07-10
2
Medium Priority
?
332 Views
Last Modified: 2006-11-18
I need to set the background image to div id depending on which site someone is at. i can determine the site from the UnivID but I cannot get the background to div id frame to show up.

I am using this to check for the UnivID and try to set the background image. Images exist and are in the right location cause I can use CSS to assign the image statically, but I need it dymanic. Anyone see a problem with this code?

<% if request.Querystring("UnivID") = "1" then
                   response.write("<div id='frame' background-image: url(littlerock/images/ltrk.jpg);>")
                   else if request.Querystring("UnivID") = "2" then
                             response.write("<div id='frame' background-image: url(memphis/images/memphis.jpg);>")
                             end if
          end if %>  

0
Comment
Question by:ksilvoso
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 2

Accepted Solution

by:
almes earned 500 total points
ID: 17080931
background image is a style attribute not a DIV attribute, that is why you should use:

<div id='...' style='background-image:url(...)' >

good luck...
0
 
LVL 1

Author Comment

by:ksilvoso
ID: 17107369
Thanks, that got it, altho only in IE. I will have to look around for the hack for Mozilla, or do you know what it should be?
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Now-a-days, indirectly, postal services have been replaced by email services. Yes, whenever we hear the word "email" a lot of people only think of gmail. Some people still think that email and gmail are one and the same thing :-). Let's see some …
Do you come here a lot? Are you lazy like me and don't want to go through the "trouble" of having to click your Dock's Safari icon and then having to click your Experts Exchange Favorites bookmark to get here? Well then this article is for you.
This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question