Team:Georgia State/team

From 2013.igem.org

(Difference between revisions)
 
(115 intermediate revisions not shown)
Line 2: Line 2:
<html>
<html>
<head>
<head>
-
<script>
+
<link rel="stylesheet" href="https://googledrive.com/host/0B4nfVqlTfnTzQ0V5NlQydy0xU00" type="text/css" />
-
window.onload = function () {
+
-
//scrollpane parts
+
-
var scrollPane = $( ".scroll-pane" ),
+
-
scrollContent = $( ".scroll-content" );
+
-
 
+
-
//build slider
+
-
var scrollbar = $( ".scroll-bar" ).slider({
+
-
slide: function( event, ui ) {
+
-
if ( scrollContent.width() > scrollPane.width() ) {
+
-
scrollContent.css( "margin-left", Math.round(
+
-
ui.value / 100 * ( scrollPane.width() - scrollContent.width() )
+
-
) + "px" );
+
-
} else {
+
-
scrollContent.css( "margin-left", 0 );
+
-
}
+
-
}
+
-
});
+
-
 
+
-
//append icon to handle
+
-
var handleHelper = scrollbar.find( ".ui-slider-handle" )
+
-
.mousedown(function() {
+
-
scrollbar.width( handleHelper.width() );
+
-
})
+
-
.mouseup(function() {
+
-
scrollbar.width( "100%" );
+
-
})
+
-
.append( "<span class='ui-icon ui-icon-grip-dotted-vertical'></span>" )
+
-
.wrap( "<div class='ui-handle-helper-parent'></div>" ).parent();
+
-
 
+
-
//change overflow to hidden now that slider handles the scrolling
+
-
scrollPane.css( "overflow", "hidden" );
+
-
 
+
-
//size scrollbar and handle proportionally to scroll distance
+
-
function sizeScrollbar() {
+
-
var remainder = scrollContent.width() - scrollPane.width();
+
-
var proportion = remainder / scrollContent.width();
+
-
var handleSize = scrollPane.width() - ( proportion * scrollPane.width() );
+
-
scrollbar.find( ".ui-slider-handle" ).css({
+
-
width: handleSize,
+
-
"margin-left": -handleSize / 2
+
-
});
+
-
handleHelper.width( "" ).width( scrollbar.width() - handleSize );
+
-
}
+
-
 
+
-
//reset slider value based on scroll content position
+
-
function resetValue() {
+
-
var remainder = scrollPane.width() - scrollContent.width();
+
-
var leftVal = scrollContent.css( "margin-left" ) === "auto" ? 0 :
+
-
parseInt( scrollContent.css( "margin-left" ) );
+
-
var percentage = Math.round( leftVal / remainder * 100 );
+
-
scrollbar.slider( "value", percentage );
+
-
}
+
-
 
+
-
//if the slider is 100% and window gets larger, reveal content
+
-
function reflowContent() {
+
-
var showing = scrollContent.width() + parseInt( scrollContent.css( "margin-left" ), 10 );
+
-
var gap = scrollPane.width() - showing;
+
-
if ( gap > 0 ) {
+
-
scrollContent.css( "margin-left", parseInt( scrollContent.css( "margin-left" ), 10 ) + gap );
+
-
}
+
-
}
+
-
 
+
-
//change handle position on window resize
+
-
$( window ).resize(function() {
+
-
resetValue();
+
-
sizeScrollbar();
+
-
reflowContent();
+
-
});
+
-
//init scrollbar size
+
-
setTimeout( sizeScrollbar, 10 );//safari wants a timeout
+
-
};
+
-
</script>
+
</head>
</head>
<body>
<body>
-
<div class="slider">
+
<img style="position:absolute; top: 330px; left:300px;" src="https://googledrive.com/host/0B4nfVqlTfnTzWkUwbTBTVzE4dzA" width="500" />
 +
<div class="description" style="vertical-align:top;">
 +
<h2 style="vertical-align:top;">The Team</h2>
 +
<ul>
 +
<li><a href="/Team:Georgia_State/Team/members">Members</a></li>
 +
<li><a href="/Team:Georgia_State/Team/faculty">Faculty</a></li>
 +
</ul>
-
<div class="scroll-pane ui-widget ui-widget-header ui-corner-all">
+
</div>
-
        <ul class="scroll-content">
+
-
            <li><img src="https://googledrive.com/host/0B4nfVqlTfnTzWDVMRzBEd1RwX2s" alt="Image 1" /></li>
+
-
            <li><img src="mad-02.jpg" alt="Image 2" /></li>
+
-
            <li><img src="mad-03.jpg" alt="Image 3" /></li>
+
-
            <li><img src="mad-04.jpg" alt="Image 4" /></li>
+
-
            <li><img src="mad-05.jpg" alt="Image 5" /></li>
+
-
            <li><img src="mad-06.jpg" alt="Image 6" /></li>
+
-
            <li><img src="mad-07.jpg" alt="Image 7" /></li>
+
-
            <li><img src="mad-08.jpg" alt="Image 8" /></li>
+
-
            <li><img src="mad-09.jpg" alt="Image 9" /></li>
+
-
            <li><img src="mad-10.jpg" alt="Image 10" /></li>
+
-
            <li><img src="mad-11.jpg" alt="Image 11" /></li>
+
-
        </ul>
+
-
<div class="scroll-bar-wrap ui-widget-content ui-corner-bottom">
+
-
<div class="scroll-bar"></div>
+
-
</div>
+
-
</div>
+
-
</div><!-- .slider -->
 
</body>
</body>
</html>
</html>

Latest revision as of 21:27, 21 September 2013

Georgia State Wiki

The Team