Team:NTNU Trondheim/Test

From 2012.igem.org

(Difference between revisions)
Line 137: Line 137:
     padding-right:14px;
     padding-right:14px;
}
}
-
</style><pre>
+
</style>
-
&lt;script type=&quot;text/javascript&quot;&gt;
+
-
var fixed_menu_hidden = true;
+
-
function dtbaker_scroll(){
+
-
    var scrollTop = $(window).scrollTop();
+
-
    if(scrollTop&gt;80){
+
-
        if(fixed_menu_hidden){
+
-
            $('#fixednav').fadeIn();
+
-
            fixed_menu_hidden = false;
+
-
        }
+
-
    }else{
+
-
        $('#fixednav').fadeOut();
+
-
        fixed_menu_hidden = true;
+
-
    }
+
-
}
+
-
window.onscroll = dtbaker_scroll;
+
-
$(function(){
+
-
    $('body').prepend('&lt;div id=&quot;fixednav&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;');
+
-
    $('#fixednav div').html($('#navigation ul').clone());
+
-
});
+
-
&lt;/script&gt;
+
-
&lt;style type=&quot;text/css&quot;&gt;
+
-
#fixednav{
+
-
    position:fixed;
+
-
    left:0;
+
-
    right:0;
+
-
    top:0;
+
-
    height:39px;
+
-
    background:#13B8D6;
+
-
    display:none;
+
-
    z-index:300;
+
-
}
+
-
#fixednav div{
+
-
    width:994px;
+
-
    margin:0 auto;
+
-
}
+
-
#fixednav ul{
+
-
    list-style:none;
+
-
    margin:0 0 0 110px;
+
-
    padding:0;
+
-
}
+
-
#fixednav ul li{
+
-
    list-style:none;
+
-
    margin:0;
+
-
    padding:0;
+
-
    float:left;
+
-
}
+
-
#fixednav ul li a{
+
-
    display:block;
+
-
    margin:0;
+
-
    padding:12px 13px 8px 13px;
+
-
    float:left;
+
-
    height:19px;
+
-
    border-left:1px solid #84daea;
+
-
    border-right:1px solid #15a1bb;
+
-
    font-family: Cuprum, Helvetica, 'Helvetica Neue', arial;
+
-
    font-size: 1.4em;
+
-
    text-transform:uppercase;
+
-
    text-decoration:none;
+
-
    color:#FFF;
+
-
}
+
-
#fixednav ul li a.selected{
+
-
    height:24px !important;
+
-
    background:#15a1bb url('/new/images/menu_arrow_down.gif') no-repeat center bottom !important;
+
-
    border-right:none;
+
-
    border-left:none;
+
-
    padding-left:14px;
+
-
    padding-right:14px;
+
-
}
+
-
#fixednav ul li a:hover{
+
-
    background:#15a1bb;
+
-
    height:19px;
+
-
    text-decoration:underline;
+
-
}
+
-
#fixednav ul li.first a{
+
-
    border-left:none;
+
-
    padding-left:14px;
+
-
}
+
-
#fixednav ul li.last a{
+
-
    border-right:none;
+
-
    padding-right:14px;
+
-
}
+
-
&lt;/style&gt;</pre>
+
-
 
+
-
+
-
 
+
-
<p>&nbsp;</p>
+
-
<p>&nbsp;</p>
+
-
 
+
-
<div style="margin-left:-20px;">
+
-
<script type="text/javascript"><!--
+
-
google_ad_client = "ca-pub-1818678593670533";
+
-
/* 728x90, created 03/01/10 */
+
-
google_ad_slot = "3763237052";
+
-
google_ad_width = 728;
+
-
google_ad_height = 90;
+
-
//-->
+
-
</script>
+
-
<script type="text/javascript"
+
-
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
+
-
</script>
+
-
</div>
+
<div class="comments-add-form">
<div class="comments-add-form">
-
<h6>Comments:</h6>
+
<h6
-
<!--<a href="#" onclick="$(this).parent().hide(); $('#comments_toggle').show(); return false;">Show comments</a>-->
+
-
</div>
+
-
<div id="comments_toggle">
+
-
<script language="javascript" type="text/javascript">
+
-
function comment_validate_post(){
+
-
var error=false, required='';
+
-
+
-
if(document.getElementById('comments-add-name') && document.getElementById('comments-add-name').value==''){
+
-
error=true;
+
-
required += " 'Your Name' ";
+
-
}
+
-
+
-
+
-
if(document.getElementById('comments-add-email') && document.getElementById('comments-add-email').value==''){
+
-
error=true;
+
-
required += " 'Your Email' ";
+
-
}
+
-
+
-
+
-
if(document.getElementById('comments-add-text') && document.getElementById('comments-add-text').value==''){
+
-
error=true;
+
-
required += " 'Your Comment' ";
+
-
}
+
-
+
-
+
-
if(document.getElementById('comments-add-captcha_auth') && document.getElementById('comments-add-captcha_auth').value==''){
+
-
error=true;
+
-
required += " 'Maths question' ";
+
-
}
+
-
+
-
if(error){
+
-
alert('Please complete required fields: '+required);
+
-
return false;
+
-
}else{
+
-
return true;
+
-
}
+
-
}
+
-
function comment_reply(comment_id,author,date){
+
-
if(typeof(document.getElementById('parent_comment_id'))!="undefined"){
+
-
document.getElementById('parent_comment_id').value=comment_id;
+
-
}
+
-
if(typeof(document.getElementById('comments-reply-info'))!="undefined"){
+
-
document.getElementById('comments-reply-info').innerHTML = "Reply to <strong>"+author+"'s</strong> comment on "+date;
+
-
}
+
-
if(typeof(document.getElementById('comments-reply-cancel'))!="undefined"){
+
-
document.getElementById('comments-reply-cancel').style.display = "block";
+
-
}
+
-
}
+
-
function cancel_comment_reply(){
+
-
if(typeof(document.getElementById('parent_comment_id'))!="undefined"){
+
-
document.getElementById('parent_comment_id').value='';
+
-
}
+
-
if(typeof(document.getElementById('comments-reply-info'))!="undefined"){
+
-
document.getElementById('comments-reply-info').innerHTML = "";
+
-
}
+
-
if(typeof(document.getElementById('comments-reply-cancel'))!="undefined"){
+
-
document.getElementById('comments-reply-cancel').style.display = "none";
+
-
}
+
-
}
+
-
</script>
+
-
<style type="text/css">
+
-
+
-
.comments-outer{
+
-
+
-
}
+
-
.comments-comment-wrap{
+
-
margin:10px 0px;
+
-
}
+
-
.comments-header{
+
-
+
-
}
+
-
.comments-header h6,
+
-
.comments-add-form h6{
+
-
font-size:20px;
+
-
clear:both;
+
-
}
+
-
.comments-list{
+
-
list-style:none;
+
-
margin:10px;
+
-
padding:0;
+
-
}
+
-
.comments-list li{
+
-
list-style:none;
+
-
margin:0;
+
-
padding:9px 0 0 0;
+
-
clear:both;
+
-
border-top:1px solid #EFEFEF;
+
-
border-bottom:1px solid #EFEFEF;
+
-
}
+
-
.comments-list li.comments-last{
+
-
border-bottom:0;
+
-
}
+
-
.comments-list li .comments-list{
+
-
margin-left:20px !important;
+
-
}
+
-
.comments-author{
+
-
float:left;
+
-
width:140px;
+
-
margin-right:30px;
+
-
clear:left;
+
-
text-align:right;
+
-
}
+
-
.comments-author p{
+
-
margin:5px 0;
+
-
padding:0 !important;
+
-
line-height:normal !important;
+
-
}
+
-
.comments-author-icon{
+
-
+
-
}
+
-
.comments-author-name{
+
-
font-size:18px;
+
-
}
+
-
.comments-author-date{
+
-
font-size:11px;
+
-
color:#CBCBCB;
+
-
}
+
-
.comments-approval{
+
-
font-size:11px;
+
-
color:#FF0000;
+
-
font-style:italic;
+
-
}
+
-
.comments-admin{
+
-
border:1px dashed #CCC;
+
-
}
+
-
.comments-clear{
+
-
clear:both;
+
-
height:0;
+
-
visibility:hidden;
+
-
border:0;
+
-
padding:0;
+
-
margin:0;
+
-
}
+
-
.comments-text{
+
-
float:left;
+
-
width:400px;
+
-
color:#5d5949;
+
-
padding:20px;
+
-
background-color:#fafafa;
+
-
border:1px solid #dadada;
+
-
font-size:13px;
+
-
line-height:15px;
+
-
padding-bottom:5px;
+
-
min-height:150px;
+
-
height:auto !important;
+
-
height:150px
+
-
}
+
-
.comments-list li.comments-even .comments-text{
+
-
background-color:#EAEAEA;
+
-
margin-bottom:-2px;
+
-
position:relative;
+
-
top:-1px;
+
-
}
+
-
.comments-list li.comments-odd .comments-text{
+
-
+
-
}
+
-
.comments-text p{
+
-
+
-
}
+
-
.comments-btn{
+
-
display:block;
+
-
margin:2px;
+
-
padding:3px;
+
-
background-color:#ff9437;
+
-
color:#FFFFFF;
+
-
font-size:11px;
+
-
width:70px;
+
-
float:left;
+
-
text-decoration:none;
+
-
}
+
-
.comments-btn:hover{
+
-
text-decoration:underline;
+
-
}
+
-
.comments-add-form{
+
-
margin:0;
+
-
clear:both;
+
-
}
+
-
.comments-add-form-wrap{
+
-
margin:10px 0;
+
-
clear:both;
+
-
}
+
-
.comments-add-form label{
+
-
clear:left;
+
-
display:block;
+
-
font-weight:normal;
+
-
}
+
-
.comments-add-form h6{
+
-
+
-
}
+
-
.comments-input{
+
-
border:1px solid #CCCCCC;
+
-
padding:5px;
+
-
font-family:arial;
+
-
font-size:14px;
+
-
}
+
-
.comments-add-err{
+
-
border:2px solid #FF0000 !important;
+
-
}
+
-
.comments-add-form input.comments-input{
+
-
width:200px;
+
-
}
+
-
.comments-add-form textarea.comments-input{
+
-
width:300px;
+
-
height:100px;
+
-
}
+
-
+
-
</style>
+
-
<div class="comments-outer">
+
-
<div class="comments-comment-wrap">
+
-
<a name="comments"></a>
+
-
        <div class="comments-header">
+
-
<h6>Comments</h6> </div>
+
-
+
-
+
-
<ol class="comments-list">
+
-
+
-
<li class="comments-odd comments-last" id="comments-0">
+
-
<div class="comments-author">
+
-
<a name="comment-0"></a>
+
-
<a title="Get your avatar from Gravatar!" class="comments-author-icon" href="http://www.gravatar.com/" target="_blank">
+
-
<img src="http://www.gravatar.com/avatar.php?
+
-
gravatar_id=994eee8938dbad7eb0f30e132236048e&default=wavatar&size=60" alt="Gravatar" border="0">
+
-
</a>
+
-
<p class="comments-author-name">
+
-
                       
+
-
<a href="http://www.sitefloat.com" target="_blank">
+
-
+
-
mike
+
-
</a>
+
-
</p>
+
-
<p class="comments-author-date">
+
-
<a href="http://dtbaker.com.au/random-bits/stick-the-menu-to-the-top-of-the-page-on-scroll-down.html#comment-0">March 17th, 2011</a>
+
-
</p>
+
-
<p class="comments-author-reply">
+
-
<a href="#post-comment" onClick="comment_reply(0,'mike','March 17th, 2011'); ">Reply</a>
+
-
</p>
+
-
</div>
+
-
<div class="comments-text">
+
-
+
-
+
-
<p>
+
-
awesome :) well done on the site guys!<br /> </p>
+
-
</div>
+
-
                    <hr class="comments-clear">
+
-
                    </li>
+
-
</ol>
+
-
+
-
+
-
<hr class="comments-clear">
+
-
<div class="comments-line"></div>
+
-
            </div>
+
-
<div class="comments-add-form-wrap">
+
-
<a name="post-comment"></a>
+
-
<form action="/widget-comments.php?post=gogo" method="post" class="comments-add-form" onSubmit="if(typeof(comment_validate_post)=='function')return comment_validate_post(); else return true;">
+
-
+
-
<h6>Leave a Comment</h6> <div id="comments-reply-info"></div>
+
-
<div id="comments-reply-cancel" style="display:none;"><a href="#" onclick="cancel_comment_reply(); return false;">Cancel making reply</a></div>
+
-
+
-
<p>
+
-
<input type="hidden" name="captcha_auth" value="8f14e45fceea167a5a36dedd4bea2543">
+
-
<label for="comments-add-name">
+
-
Your Name </label>
+
-
<input type="text" name="comment_name" class="comments-input comments-add-name" id="comments-add-name" value="">
+
-
+
-
<label for="comments-add-email">
+
-
Your Email <small><em>(never published)</em></small>
+
-
</label>
+
-
<input type="text" name="comment_email" class="comments-input comments-add-email" id="comments-add-email" value="">
+
-
+
-
<label for="comments-add-website">
+
-
Your Website </label>
+
-
<input type="text" name="comment_website" class="comments-input comments-add-website" id="comments-add-website" value="">
+
-
+
-
<label for="comments-add-text">
+
-
Your Comment </label>
+
-
<textarea name="comment_text" class="comments-input comments-add-text" id="comments-add-text"></textarea>
+
-
+
-
<label for="comments-add-captcha_auth">
+
-
SPAM Prevention Question: What is 1 + 6? </label>
+
-
<input type="text" name="comment_captcha_auth" class="comments-input comments-add-captcha_auth" id="comments-add-captcha_auth" value="">
+
-
+
-
<label for="comments-add-comment_subscribe">
+
-
Subscribe to updates? </label>
+
-
<input type="checkbox" name="comment_comment_subscribe" class="comments-add-comment_subscribe" id="comments-add-comment_subscribe" value="1" > <small>Yes, send me an email when a new comment is posted.</small>
+
-
</p>
+
-
<p>
+
-
<input type="submit" name="submit" value="Post Comment" border="0">
+
-
</p>
+
-
<p>
+
-
<em>The avatars shown next to comments are Gravatars.
+
-
<a href="http://www.gravatar.com/" target="_blank">Click here to get a Gravatar account for free</a>
+
-
and any other site that supports it will show your avatar too!</em>
+
-
</p>
+
-
<input type="hidden" name="comment_block_uri" value="/random-bits/stick-the-menu-to-the-top-of-the-page-on-scroll-down.html">
+
-
<input type="hidden" name="parent_comment_id" id="parent_comment_id" value="">
+
-
+
-
</form>
+
-
</div>
+
-
</div>
+
-
</div>
+
-
</div>
+
-
 
+
-
            </div>
+
            <div id="content_sidebar">
            <div id="content_sidebar">
                 <div class="column">
                 <div class="column">

Revision as of 13:25, 9 August 2012

Stick the menu to the top of the page on scroll down

« Return to all random blog posts

02
Feb 2011

Stick the menu to the top of the page on scroll down

Just a little something I wanted to try. Scroll down the page and watch the menu above stick to the top so it's always accessible. 

Here's the code used:

 

Ultimate Client Manager:

Ultimate Client Manager - Pro Edition! - PHP Open Source
PRO EDITION! Just launched!

The Ultimate Client Manager allows you to track all your customers, projects, PDF invoices and customer websites details.
LOTS MORE features listed here.

Sell your Products on Facebook

Facebook Tab E-Commerce Wordpress
Facebook Jigoshop E-Commerce Plugin

This simple plugins lets you sell your products to your Facebook Fans straight from your Facebook Page. Click here to read more and see a demo.

Newsletter System
PHP Newsletter System

This PHP newsletter system is a simple solution for sending emails out via your website. People can subscribe through your site, and you can track who opens which email. More features listed here.

View Demo Code Canyon Newsletter System Download

WordPress Bulk Emails:

Wordpress Newsletter System
WordPress Email Newsletter Campaign Plugin

This PHP WordPress Plugin is a simple solution for sending bulk emails via your blog. People can subscribe through your blog, and you can track who opens which email. More features listed here.

View Demo CodeCanyon WordPress Email Newsletter Plugin

Browse our Themes:

  • 1

    Pink HTML

    This is a stand alone Pink HTML shop website. You can use this template with any shopping cart software of your choice.
  • 2

    White HTML

    This is a stand alone White HTML shop website. You can use this template with any shopping cart software of your choice.
  • 3

    Pink PHP Shop

    This is a Pink PHP shop website. This code has been split into easy to use header/footer PHP files. Includes a bonus basic php shopping cart. Great for anyone with PHP knowledge.
  • 4

    White PHP Shop

    This is a White PHP shop website. This code has been split into easy to use header/footer PHP files. Includes a bonus basic php shopping cart. Great for anyone with PHP knowledge.
  • 5

    Kids HTML Website Template

  • 6

    Kids - Grass Footer

  • 7

    Kids Website - Sand / Beach

  • 8

    Kids - Underwater

  • 9

    Kids Toys - no footer

  • 10

    HTML Template

  • 11

    HTML Template

  • 12

    Brown WP Template

  • 13

    Black WP Template

  • 14

    Blue WP Template

  • 15

    Green WP Template

  • 16

    Red WP Template

  • 17

    Orange WP Template

  • 18

    Blue HTML Template

  • 19

    Brown HTML Template

  • 20

    WWW Template

  • 21

    Choc & Coffee

  • 22

    Candy Cakes

  • 23

    Paper Made

  • 24

    Paper Made

  • 25

    Eco Enviro

    A great template with a paper / eco / recycle feel to it.
  • 26

    Red

    Red/Marone website template. Designed for prestige property and realestate.
  • 27

    Grey

    The grey version of this template.
  • 28

    Blue

    Blue HTML website template. Great for businesses. Easy to modify and customise to suit your clients needs
  • 29

    Wordpress

  • 30

    Black & Green

  • 31

    Black & Green (Grass)

  • 32

    Black & Green (Leaf)

  • 33

    Black & Green (Tree)

  • 34

    Black & Grey

  • 35

    Black & Orange

  • 36

    Black & Orange (Textured)

  • 37

    Black & Pink

  • 38

    Black & Purple

  • 39

    Black & Purple & Blue

  • 40

    Black & Red

  • 41

    Black & Yellow

  • 42

    Blue & Grey

  • 43

    Blue & Orange

  • 44

    Blue & Pink

  • 45

    Child Template

    Child Care Creative - Download Website Theme Here.
  • 46

    Green Baby HTML

    Green Baby Website Template - Download ThemeForest Theme.
  • 47

    Brown Baby HTML

    Brown Baby Website Template - Download ThemeForest Theme.
  • 48

    Blue Wedding HTML

    Blue Wedding Website Template - Download ThemeForest Theme.
  • 49

    Green Baby PHP Shop

    Green Baby Website Template - with bonus Simple PHP Shop.
  • 50

    Brown Baby PHP Shop

    Brown Baby Website Template - with bonus Simple PHP Shop.
  • 51

    Blue Wedding PHP Shop

    Blue Wedding Website Template - with bonus Simple PHP Shop.
  • 52

    Sport & Grunge - Blue Version

    Sport Action Adventure Theme, Grunge - Download ThemeForest Theme.
  • 53

    Sport & Grunge - Green Version

    Sport Action Adventure Theme, Grunge - Download ThemeForest Theme.
  • 54

    Sport & Grunge - Orange Version

    Sport Action Adventure Theme, Grunge - Download ThemeForest Theme.
  • 55

    Sport & Grunge - Red Version

    Sport Action Adventure Theme, Grunge - Download ThemeForest Theme.
  • 56

    Child Care Creative Wordpress

    Child Care Creative WordPress Shop & Newsletter - Download ThemeForest Theme.
  • 57

    SingleJump - Red

    SingleJump Red Template - Single Product scrolling/jumping online Shop - Download ThemeForest Theme.
  • 58

    SingleJump - Blue

    SingleJump Blue Template - Single Product scrolling/jumping online Shop - Download ThemeForest Theme.
  • 59

    SingleJump - Brown

    SingleJump Brown Template - Single Product scrolling/jumping online Shop - Download ThemeForest Theme.
  • 60

    SingleJump - Grey

    SingleJump Grey Template - Single Product scrolling/jumping online Shop - Download ThemeForest Theme.
  • 61

    SingleJump - Kids

    SingleJump Kids Template - Single Product scrolling/jumping online Shop - Download ThemeForest Theme.
  • 62

    Blue Baby Cute WordPress

    Blue Baby,Child,kids Website Template - Download ThemeForest Theme.
  • 63

    Sport & Grunge - Blue Version

    Sport Action Adventure WordPress, Grunge - Download WordPress Template.
  • 64

    Sport & Grunge - Green Version

    Sport Action Adventure WordPress, Grunge - Download WordPress Template.
  • 65

    Sport & Grunge - Orange Version

    Sport Action Adventure WordPress, Grunge - Download WordPress Template.
  • 66

    Sport & Grunge - Red Version

    Sport Action Adventure WordPress, Grunge - Download WordPress Template.
  • 67

    Jump Eco - Blue Version

    Download Jump Eco Blue theme
  • 68

    Jump Eco - Green Version

    Download Jump Eco Green theme
  • 69

    Jump Eco - Brown Version

    Download Jump Eco Grown theme from themeforest
  • 70

    Mommy Blog HTML Template

    Download Mommy Blog HTML Theme
  • 71

    Mommy Blog Wordpress Theme

    Download Mommy Blog Wordpress Theme
  • 72

    Travel Beach Island Wordpress Theme

    Download Travel Island ThemeForest Wordpress


View All »

 

 

Want to build Robots and play with Electronics?

Gold Coast Tech Space Inc.

Come down to the Gold Coast techspace in Southport. Computers, robots, electronics, programming, chemistry. Got a cool project idea? Come use our tools. Check out gctechspace.org or RSVP for upcoming events at meetup.com.