• Resolved mikek

    (@mikek)


    Hello all,

    I’m attempting to place a javascript poll in the blank space to the right of my sidebar. I can’t seem to figure out how to use that space though. Currently, I have a twitter follow me plugin that is on the right side but I can’t seem to mimic it.

    Ideally, I’d like to add a poll which floats similar to that twitter icon but would be happy enough to just get the poll to be placed just to the right of my Google Adsense, top right corner. Any help?

    Thanks,
    Mike

    Website

Viewing 15 replies - 1 through 15 (of 16 total)
  • royho

    (@royho)

    All you have to do is create an element with a fixed position and give it a right: 0; Be sure to declare the width/height of the element and display it to block so IE is happy.

    Thread Starter mikek

    (@mikek)

    much appreciated. Still needs some tweaking though which would probably be a simple fix for you yet a bit longer for me to figure out.

    here is what created in my CSS

    #Poll{
    position:absolute;
    right:0px;
    top:150px;
    height:100%;
    width:100%;

    }

    —than placed this in index.php

    <div id=”poll”>
    javascript code
    </div>

    —I estimated the top positioning and I’m almost even with my top post but not quite there yet.

    Now the important question is where do I place this code so that it shows up on every post, page, etc… I originally posted it just before the footer php on the index.php. This worked for the main page only and would not show up on posts or my other pages (tabs). why is that?

    Thanks again,
    Mike

    Thread Starter mikek

    (@mikek)

    anyone else around to chime in with some insight?

    royho

    (@royho)

    If you want it to show in every post page, you simply put the code inside the page.php or a custom template page if you created one and not inside the index.php…

    Thread Starter mikek

    (@mikek)

    was able to change the poll to be the correct height but i still can’t figure out how to have it come up on every page/post instead of just my main page.

    any simple answer?

    Thread Starter mikek

    (@mikek)

    royho,

    for some reason your message was delayed in showing up and just got it now. I actually copied and pasted the code after the sidebar and before the footer code in

    index.php
    single.php (singlepost)
    page.php

    I have no idea why it only seems to work in index but not the others. am i pasting it in a poor area?

    Thread Starter mikek

    (@mikek)

    well it does show on the pages and posts however it actually sits between the footer and the main body which is why i didn’t notice it at first.

    so i’m interpreting that as my CSS needs to be tweaked or im pasting it in the wrong area.

    Thread Starter mikek

    (@mikek)

    one last thing i noticed…i put “right” in my css instead of “left”

    the poll shows up on the left side on my main page rather than the right side. I might have more coding problems than I originally thought. Regardless if I put left or right in CSS, it shows up on the left. I happen to like it on the left so that isn’t an issue but that may create more problems for me in the future if I don’t understand why that is.

    thanks again

    royho

    (@royho)

    You can’t specific left or right because it is not floated…Once it’s declared as positioned fixed or absolute it takes itself out of the flow, so you just have to make sure you have the line of code within a container that is relative…

    Thread Starter mikek

    (@mikek)

    yea…i noticed that when using firebug on the followme plugin for twitter. still trying to figure out how to put it under a container which is relative. That is beyond my skill-set at the moment.

    can you direct me to any websites that would give me a simplified explanation on how to do this?

    much appreciated.

    Thread Starter mikek

    (@mikek)

    well i figured it out and created this in CSS above #poll

    .poll{
    position:relative;

    }

    #poll{
    position:absolute;
    left:0px;
    top:120px;
    height:100%;
    width:100%;

    }

    —now it works on firefox however i glanced at my site on IE8 and it seems my entire site is aligned left on the main page but my other pages it is aligned normally however the poll is at the very bottom of the page again. I’m guessing I might have another problem with my coding in addition to this.

    royho

    (@royho)

    But the way you’re doing it, if someone with 1024×768 screen resolution, your vote poll will be covered by your main page and overlap. Not a good practice…Better way is to utilize jQuery to show just a VOTE TAB and when clicked, it will slide out to show the whole vote element…

    Thread Starter mikek

    (@mikek)

    alright figured out how to fix the site as a whole on IE8 however I still can’t get the poll to place in the proper area on IE8 whereas it works perfectly fine on firefox now.

    any suggestions?

    Thread Starter mikek

    (@mikek)

    well its working now on IE8 and I have no idea why its working all of a sudden. Wish I could have listed the reason so if someone needs this thread in the future. Either way, thank you very much for your help royho.

    Thread Starter mikek

    (@mikek)

    Royho, for some reason your messages show up hours later to me. I’m not familiar with how to utilize jQuery. Do you have a preferred link to help me familiarize myself with it so I can figure out how to code it?

    Thanks again,
    Mike

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘how to utilize the blank space around my page’ is closed to new replies.