1 Replies - 2089 Views - Last Post: 01 January 2014 - 07:21 AM

#1 markblack   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 01-January 14

scrolling type with page.

Posted 01 January 2014 - 07:11 AM

hello,

sorry new to this, I'm trying to get the type to scroll with a page as you scroll down on this site:

www.markblack.co.uk

at the moment as it scrolls the copy jumps to the left and overlaps the images, it does however scroll. just click on any thumbnail to see the the problem.

I have used this code:

 <script type="text/javascript">
    $(window).scroll(function() {
        var final_top = $('#maincontainer').height() + $('#maincontainer').offset().top;
        var final_pos = $('#maincontainer').height() - $(".project_text").height();
        var final_mid = final_top-$(".project_text").height();

        if($(document).scrollTop() >= final_mid && $(".project_text").css('top') == "auto") {
            $(".project_text").css('position', 'absolute').css('top', final_pos);
        } else if($(document).scrollTop() <= final_mid) {
            $(".project_text").css('position', 'fixed').css('top', 'auto');
        }
    });
</script> 


any help would be much appreciated.

thanks and a happy new year!

Mark

Is This A Good Question/Topic? 0
  • +

Replies To: scrolling type with page.

#2 andrewsw   User is offline

  • no more Mr Potato Head
  • member icon

Reputation: 6957
  • View blog
  • Posts: 28,696
  • Joined: 12-December 12

Re: scrolling type with page.

Posted 01 January 2014 - 07:21 AM

Javascript and Java are two completely different languages.

Topic moved to the jQuery forum.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1