Posted: June 20th, 2008

Apple Iphone slider bar recreated in jquery

Category: technical

You ever wonder how to re-create those cool looking slider techniques in the apple iphone?
well you too can create them on your website using simple tools like jQuery and jQuery Ui


off
on

first thing is throw in your header the 2 files needed,

<script src="/js/jquery.js" type="text/javascript"><script>
<script src="/js/ui-jquery.js" type="text/javascript"><script>

grab the images.

and this code, throw the script and style in the head of your page.

<script>
//
// required jquery , and jquery ui 
// created by flowerpoop
// share with all your friends.
// questions? leave a comment below.
//
//
$(document).ready(function(){
    $("#block").draggable(
        { // drag along the x-axis and stay in the parent
        axis: "x",
        containment: "parent",
        snap: $("#bar"),
        snapMode: 'inner',
        snapTolerance: 20,
        stop: function() {
            position = $("#block").position();
            if (position.left > 100) { //changes the postion of the arrow
                $("#bk").attr("src","/images/s_bar_left.png");
                $("#ss").attr("class","shaded");
                $("#uns").attr("class", "solid");
            };
            if (position.left < 10) {  //changes the postion of the arrow
                $("#bk").attr("src","/images/s_bar_right.png");
                $("#ss").attr("class","solid");
                $("#uns").attr("class","shaded");
            };
        }
        }
    );
    //makes clicking on the text as well
    $("#uns").click(function(){
        $("#block").animate(
        {left: 0},
        500,
        null,
        function(){
            $("#ss").attr("class","solid");
            $("#uns").attr("class","shaded");
            $("#bk").attr("src","/images/s_bar_right.png");
        });
    });
    //makes clicking on the text as well
    $("#ss").click(function(){
        $("#block").animate(
        {left: 111},
        500,
        null,
        function(){
            $("#ss").attr("class","shaded");
            $("#uns").attr("class","solid");
            $("#bk").attr("src","/images/s_bar_left.png");
        });
    });
});
</script>
<style>
.shaded {
    cursor:pointer; 
    font-size:8pt; 
    margin:0 3px; 
    color:#FFFFFF; 
    opacity: 0.1; 
    margin-top:5px; 
    filter: alpha(opacity=10)
}
.solid {
    cursor:pointer; 
    font-size:8pt; 
    margin:0 3px; 
    margin-top:5px;
}
#bar {
    position:relative; 
    margin:0 2px; 
    background:transparent url('/images/s_bar.png') no-repeat scroll center top; 
    width:145px; 
    height:23px;
}
#block {
    cursor:pointer; 
    position:absolute; 
    margin-top:2px; 
    z-index:1
}
</style>

<div id="bar">
    <div id="block">
        <img id="bk" src="/images/s_bar_right.png" />
    </div>
    <div id="uns" class="shaded" style="float:left;">off</div>
    <div id="ss" class="solid" style="float:right;">on</div>
</div>
Posted: June 16th, 2008

spammers delight

Category: PLAIN, technical
Tags:

for some strange reason i keep getting hit with spam registrations.

Today’s bot registered with a name of jacob73kolp and an e-mail address of jacobkolp@gmail.com.

This brings the total of known bots to five:

  • adol77dai51
  • alina77vere9uk
  • ralyjones25
  • ken75muraski
  • jacob73kolp

I have placed these non poopers in my blacklist.
its an easy wordpress plugin.

http://web-professor.net/scripts/

the guy who runs it looks like steven colbert.

Posted: June 15th, 2008

Lakers Win Game 5

Category: PLAIN

Yea!

but will they win the series?

Posted: June 15th, 2008

more potatoheads than i can imagine.

Category: PLAIN

can i say more? i wish i had a better shot.

Your Ad Here
Posted: June 15th, 2008

strange seaweed

Category: PLAIN

looks kinda interesting.

Your Ad Here