PDA

View Full Version : help with CMotion Image Gallery



mistral
12-08-2005, 08:34 PM
http://www.dynamicdrive.com/dynamicindex4/cmotiongallery.htm

Here is one problem: I can no use an internal or internal .css file, just because all my pages are dynamically generated by CMS(include content, header tags)-so this css reference will be inserted by CMS in all website pages, not in specific only. So I decided just use inline CSS style -apply this css fragments into the "style" attribute.
Here is how it looks with inline css :


<div style="text-align: center; width:auto; margin: 0 auto;">

<div id="motioncontainer" style="position:relative;width:400px;height:150px;overflow:hidden; a: img border: 1px solid #ccc; a:hover img border: 1px solid navy; a:hover color: red;">
<div id="motiongallery" style="position:absolute;left:0;top:0;white-space: nowrap;">
<div id="statusdiv" style="position: absolute;padding: 2px;left: -300px;background-color: lightyellow;border: 1px solid gray;visibility: hidden;">

<nobr id="trueContainer"><a href="javascript:enlargeimage('dynamicbook1.gif')"><img src="dynamicbook1.gif" border=1></a> <a href="javascript:enlargeimage('dynamicbook1.gif', 300, 300)"><img src="dynamicbook1.gif" border=1></a> <a href="http://www.dynamicdrive.com"><img src="dynamicbook1.gif" border=1></a> <a href="#"><img src="dynamicbook1.gif" border=1></a> <a href="#"><img src="dynamicbook1.gif" border=1></a> <a href="#"><img src="dynamicbook1.gif" border=1></a> <a href="#"><img src="dynamicbook1.gif" border=1></a> <a href="#"><img src="dynamicbook1.gif" border=1></a> <a href="#"><img src="dynamicbook1.gif" border=1></a></nobr>

</div>
</div>
</div>



I am not sure about the <div id="statusdiv" - originally this property is in external CSS file, and the .js file references to "statusdiv" css property. But I can no use it as external css. Where to implement it? Any ideas?

jscheuer1
12-08-2005, 08:51 PM
Don't write it into your HTML like that at all. Leave it to the script. Edit the script so that it applies the required styles to the status division just after its creation:


function creatediv(){
statusdiv=document.createElement("div")
statusdiv.setAttribute("id","statusdiv")
with (statusdiv.style) {
position='absolute';
padding='2px';
left='-300px';
backgroundColor='lightyellow';
border='1px solid gray';
visibility='hidden';
}
document.body.appendChild(statusdiv)
statusdiv=document.getElementById("statusdiv")
statusdiv.innerHTML=endofgallerymsg
}