Results 1 to 2 of 2

Thread: help with CMotion Image Gallery

  1. #1
    Join Date
    Dec 2005
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default help with CMotion Image Gallery

    http://www.dynamicdrive.com/dynamici...iongallery.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 :
    Code:
    <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?

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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:

    Code:
    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
    }
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •