Code for image that movies with page (floating?)

Discussion in 'HTML & Website Design' started by acatmusic, Jun 11, 2010.

  1. #1
    hello,
    i have a blog and im looking to add an image in the top right hand that movies down when people scroll and links to another page. ive tried to search for this code on google but perhaps im using the wrong term to describe what im looking for. im not refering to the background. im trying to add a small image on the top right corner that will move along with everything as people scroll down (but will not be bouncing around as ive seen when i searched floating image). can you guys help me find the code for this or tell me what the technical term is so i can search for it? thanks in advance!
     
    acatmusic, Jun 11, 2010 IP
  2. -M-A-R-K-

    -M-A-R-K- Peon

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Try this: http://www.dynamicdrive.com/dynamicindex4/logo.htm

    You have to edit the JS file.

    setting: {orientation:[COLOR="Red"]4[/COLOR], visibleduration:20000, fadeduration:[1000, 500]}, //orientation=1|2|3|4, duration=millisec, fadedurations=millisecs
    offsets: {x:10, y:10},//offset of logo relative to window corner
    logoHTML: '<a href="http://www.dynamicdrive.com" title="Dynamic Drive"><img src="[COLOR="Red"]logo.gif" style="width:50px; height:47px; border:0[/COLOR]" /></a>', //HTML for logo, which is auto wrapped in DIV w/ ID="mysitelogo"
    Code (markup):
    Change the stuff in red

    For the orientation, change the 4 to 2 if you want it in the top right corner
     
    -M-A-R-K-, Jun 12, 2010 IP
  3. acatmusic

    acatmusic Active Member

    Messages:
    204
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    55
    #3
    mark, i cant upload the js file since im hosting through blogger, is there a way to work around this? or perhaps a different method of doing it?

    thanks for your help
     
    acatmusic, Jun 12, 2010 IP
  4. Cash Nebula

    Cash Nebula Peon

    Messages:
    1,197
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Simple, use fixed positioning:
    
    <a href="#"><img id='fixedImage' src='fixedImage.jpg' /></a>
    
    #fixedImage {
    	position: fixed;
    	right: 0;
    	top: 0;
    }
    Code (markup):
    Or if you want to use inline styling:
    
    <a href="#"><img style="position: fixed; right: 0; top: 0;" src='fixedImage.jpg' /></a>
    
    Code (markup):
     
    Cash Nebula, Jun 12, 2010 IP
  5. acatmusic

    acatmusic Active Member

    Messages:
    204
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    55
    #5
    the inline styling seems to be working. thank you very much.
     
    acatmusic, Jun 12, 2010 IP
  6. NoamBarz

    NoamBarz Active Member

    Messages:
    242
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    58