PDA

View Full Version : DHTML Window widget (v1.1) CSS Question



SewnEyes
02-29-2008, 06:19 AM
1) Script Title: DHTML Window widget (v1.1)

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex8/dhtmlwindow/

3) Describe problem: I was wondering if there was a way to assign different CSS styles to multiple Window widgets on my page. I am somewhat of a newbie to CSS but have got everything to work in this script perfectly fine (a great script, by the way) but I want to assign different images to the handling bar at the top of the windows to give the appearance of chromeless windows. I have changed the main dhtmlwindow.css to include "background-image:url(bg.jpg)" under ".drag-handle" but, as expected, this affects all windows that pop up from the various buttons that I have on my site. I have tried to setup and load stylesheets with different names into the HTML but I am really confused as to how these windows are linking to those CSS documents. Is there any way to assign a different CSS stylesheet to each idividual window?

Thanks in advance for any help. I would be more than happy to supply a URL if necessary but since this is a rather generic question I would prefer to avoid a scolding for my messy code (I'm a graphic designer by trade working on my portfolio site...:o)

ddadmin
02-29-2008, 06:59 AM
One way to do this is just to realize that when you open a DHTML window, ie:


<script type="text/javascript">
var googlewin=dhtmlwindow.open("googlebox", "iframe", "http://google.com", "Google Web site", "width=700px,height=450px,resize=1,scrolling=1,center=1", "recal")
</script>

The first parameter in red corresponds to that DHTML Window main DIV's id attribute. So you can predefine additional CSS that targets that DHTML window specifically that way, such as:


<style type="text/css">
#googlebox .drag-handle{
//addtional CSS here
"
}
</style>

SewnEyes
02-29-2008, 08:04 AM
Man, and I knew it was going to be something that simple. Thanks a bunch for the quick reply. I only wish now that I mustered up the nerve to ask earlier today, it would've literally saved me HOURS of time. Thanks again, so much!

ddadmin
02-29-2008, 08:35 AM
You're welcome. :)