最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
当前位置: 首页 - 科技 - 知识百科 - 正文

jquerytoolbar与网页浮动工具条具体实现代码_jquery

来源:动视网 责编:小采 时间:2020-11-27 21:18:38
文档

jquerytoolbar与网页浮动工具条具体实现代码_jquery

jquerytoolbar与网页浮动工具条具体实现代码_jquery:jquery 实现toolbar与网页浮动工具条jQuery实现方法 /* 基本StructureWe'll更新index.php教程的HTML代码和对新闻联播style.css教程中的CSS代码。 我们建立了一个固定的面板(ID为工具栏组)两个浮动方面,我们将在第二个步骤与他们的图标和提示气泡(左),一
推荐度:
导读jquerytoolbar与网页浮动工具条具体实现代码_jquery:jquery 实现toolbar与网页浮动工具条jQuery实现方法 /* 基本StructureWe'll更新index.php教程的HTML代码和对新闻联播style.css教程中的CSS代码。 我们建立了一个固定的面板(ID为工具栏组)两个浮动方面,我们将在第二个步骤与他们的图标和提示气泡(左),一


jquery 实现toolbar与网页浮动工具条jQuery实现方法
/*
基本StructureWe'll更新index.php教程的HTML代码和对新闻联播style.css教程中的CSS代码。

我们建立了一个固定的面板(ID为工具栏组)两个浮动方面,我们将在第二个步骤与他们的图标和提示气泡(左),一个快速菜单和“隐藏按钮列表”(添加到隐藏工具栏)。
我们还可以期待一个“显示按钮”,它是有用的,当面板隐藏,我们要重新激活它。基于这个原因,我们添加id为toolbarbut div标签。

HTML和CSS代码
在这里,网页的基本结构。

html 代码
代码如下:









css代码
代码如下:
div#toolbar, div#toolbarbut {
position: fixed; /* set fixed position for the bar */
bottom: 0px;
right: 0px;
z-index: 9999; /* keep the bar on top */
height: 36px;
background: url(images/bcktool.png);
/* CSS3 */
-moz-border-radius-topleft: 8px;
-khtml-border-radius-topleft: 8px;
-webkit-border-top-left-radius: 8px;
-moz-border-radius-topright: 8px;
-khtml-border-radius-topright: 8px;
-webkit-border-top-right-radius: 8px;
-moz-box-shadow: 0px 1px 10px #666, inset 1px 1px 0px #a4a4a4; /* inset creates a inner-shadow */
-khtml-box-shadow: 0px 1px 10px #666;
-webkit-box-shadow: 0px 1px 10px #666;
/* CSS3 end */
border-top: 1px solid #eee;
border-left: 1px solid #eee;
border-right: 1px solid #eee;
}

div#toolbar {
width: 85%;
min-width: 700px; /* to limit the width when there is an excessive window resize */
margin: 0px auto; /* centered toolbar */
left: 0px;
}

div#toolbar a:hover {
border: none; /* fix ‘hover' (a:hover {border-bottom: 1px dotted #666;}) border in the News Aggregator */
}

div#toolbarbut { /* div for the ‘hide status' */
width: 60px;
height: 15px;
margin-right: 3%;
display: none;
}

.leftside {
float: left;
}

.rightside {
float: right;
}

显示/隐藏按钮现在,我们可以添加“显示按钮”的代码。
代码如下:

show bar


下面的属性相对CSS类。
代码如下:
span.showbar a { /* show button */
padding: 5px;
font-size: 10px;
color: #98;
}

我们完成了后来的右侧,但现在我们可以添加“隐藏按钮”在ID为rightside分区,如图所示。
代码如下:





css
代码如下:
span.downarr { /* hide button */
float: right;
border-left: 1px solid #a4a4a4;
}

span.downarr a {
display: block;
width: 36px;
height: 26px;
padding: 25px 0 0 10px;
background: url(images/downarrow.png) no-repeat 5px 7px;
}

显示/隐藏效果与jQuery首先我们需要下载的jQuery(复制正确的文件夹中),并激活头index.php的标记。
代码如下:





我们要隐藏面板上“隐藏按钮”,点击工具栏时,应当有不可见的“显示按钮”,使我们能够恢复的面板。我们可以使用下面的jQuery的解决方案(标记后添加的代码)。
代码如下:

$(document).ready(function(){

//hide toolbar and make visible the ‘show' button
$(“span.downarr a”).click(function() {
$(“#toolbar”).slideToggle(“fast”);
$(“#toolbarbut”).fadeIn(“slow”);
});

//show toolbar and hide the ‘show' button
$(“span.showbar a”).click(function() {
$(“#toolbar”).slideToggle(“fast”);
$(“#toolbarbut”).fadeOut();
});

});



现在我们可以隐藏和显示的bar

HTML和CSS代码的左侧
更新索引用下面的XHTML代码。我们添加一个普通无序列表(ID为社会)来创建的图标顺序,一个DIV标签(与类一角)范围内的总表,以实现工具提示气泡里的标签嵌套。
代码如下:
html





  • 580 Readers

  • [Subscribe]







  • Share Page

  • | Profile







  • ReTweet

  • | Profile







  • Bookmark

  • | Profile







  • Digg

  • | Profile







  • Stumble

  • | Profile





  • css代码

    *– Left Side –*/

    ul#social li {
    display: inline;
    }

    a.rss {
    display: inline-block;
    width: 104px;
    height: 35px;
    margin-left: 5px;
    background: url(images/rss.png) no-repeat;
    }

    a., a., a.digg, a.delicious, a.stumble {
    display: inline-block;
    width: 40px;
    height: 35px;
    margin-top: 1px;
    }

    a.rss:hover, a.:hover, a.:hover, a.digg:hover, a.delicious:hover, a.stumble:hover {
    background-position: 1px 1px; /* simple css hover effect */
    }

    a. {
    background: url(images/.png) no-repeat;
    }

    a. {
    background: url(images/.png) no-repeat;
    }

    a.delicious {
    background: url(images/delicious.png) no-repeat;
    }

    a.digg {
    background: url(images/digg.png) no-repeat;
    }

    a.stumble {
    background: url(images/stumble.png) no-repeat;
    }

    .tip {
    position: absolute; /* important */
    top: -75px;
    width: 250px;
    height: 78px;
    background: url(images/tip.png) no-repeat;
    float: left;
    display: none;
    }

    /* custom distances for the icons */
    #tip {
    left: 75px;
    }

    #tip {
    left: 120px;
    }

    #tipdelicious {
    left: 165px;
    }

    #tipdigg {
    left: 210px;
    }

    #tipstumble {
    left: 255px;
    }

    .tip ul {
    padding: 22px 0 0 25px;
    }

    .tip ul li {
    display: inline;
    padding-left: 3px;
    }

    .tip ul li a {
    font-size: 18px;
    color: #98;
    }

    .tip ul li a:hover {
    color: #666;
    }

    .tip ul li small {
    font-size: 10px;
    }

    jquery代码

    //show tooltip when the mouse is moved over a list element
    $(“ul#social li”).hover(function() {
    $(this).find(“div”).fadeIn(“fast”).show(); //add ‘show()” for IE
    $(this).mouseleave(function () { //hide tooltip when the mouse moves off of the element
    $(this).find(“div”).hide();
    });
    });

    OK好了,我们的jquery 实现toolbar与网页浮动工具条jQuery实现方法就讲完了。
    ?>

    文档

    jquerytoolbar与网页浮动工具条具体实现代码_jquery

    jquerytoolbar与网页浮动工具条具体实现代码_jquery:jquery 实现toolbar与网页浮动工具条jQuery实现方法 /* 基本StructureWe'll更新index.php教程的HTML代码和对新闻联播style.css教程中的CSS代码。 我们建立了一个固定的面板(ID为工具栏组)两个浮动方面,我们将在第二个步骤与他们的图标和提示气泡(左),一
    推荐度:
    • 热门焦点

    最新推荐

    猜你喜欢

    热门推荐

    专题
    Top