AJAX TAB JQUERY 选项卡 标签
js
JavaScript Code
- <script>
- $(document).ready(function(){
- var Tabs = {
- 'Tab one' : 'pages/page1.html',
- 'Tab two' : 'pages/page2.html',
- 'Tab three' : 'pages/page3.html',
- 'Tab four' : 'pages/page4.html'
- }
- var colors = ['blue','green','red','orange'];
- var topLineColor = {
- blue:'lightblue',
- green:'lightgreen',
- red:'red',
- orange:'orange'
- }
- /* Looping through the Tabs object: */
- var z=0;
- $.each(Tabs,function(i,j){
- /* Sequentially creating the tabs and assigning a color from the array: */
- var tmp = $('<li><a href="#" class="tab '+colors[(z++%4)]+'">'+i+' <span class="left" /><span class="right" /></a></li>');
- /* Setting the page data for each hyperlink: */
- tmp.find('a').data('page',j);
- /* Adding the tab to the UL container: */
- $('ul.tabContainer').append(tmp);
- })
- /* Caching the tabs into a variable for better performance: */
- var the_tabs = $('.tab');
- the_tabs.click(function(e){
- /* "this" points to the clicked tab hyperlink: */
- var element = $(this);
- /* If it is currently active, return false and exit: */
- if(element.find('#overLine').length) return false;
- /* Detecting the color of the tab (it was added to the class attribute in the loop above): */
- var bg = element.attr('class').replace('tab ','');
- /* Removing the line: */
- $('#overLine').remove();
- /* Creating a new line with jQuery 1.4 by passing a second parameter: */
- $('<div>',{
- id:'overLine',
- css:{
- display:'none',
- width:element.outerWidth()-2,
- background:topLineColor[bg] || 'white'
- }}).appendTo(element).fadeIn('slow');
- /* Checking whether the AJAX fetched page has been cached: */
- if(!element.data('cache'))
- {
- /* If no cache is present, show the gif preloader and run an AJAX request: */
- $('#contentHolder').html('<img src="img/ajax_preloader.gif" width="64" height="64" class="preloader" />');
- $.get(element.data('page'),function(msg){
- $('#contentHolder').html(msg);
- /* After page was received, add it to the cache for the current hyperlink: */
- element.data('cache',msg);
- });
- }
- else $('#contentHolder').html(element.data('cache'));
- e.preventDefault();
- })
- /* Emulating a click on the first tab so that the content area is not empty: */
- the_tabs.eq(0).click();
- });
- </script>
index.html
XML/HTML Code
- <div id="main">
- <ul class="tabContainer">
- </ul>
- <div class="clear"></div>
- <div id="tabContent">
- <div id="contentHolder">
- </div>
- </div>
- </div>
相关推荐
代码简介:jquery ajax tab选项卡是一款通过鼠标点击导航条标签选项卡滑动切换,内容异步加载选项卡切换;简单的网页模板单页选项卡切换展示。
jquery tab选项卡 ajax选项卡 静态选项卡 鼠标点击
jquery ajax选项卡使用jQuery选项卡切换异步加载请求数据
jquery实现的ajax选项卡tab特效插件代码
jQuery Tab 可关闭的网页选项卡特效,网页上的标签效果,每个TAB标签都可以关闭,就像现在主流的163邮箱、QQ邮箱中的效果,模拟出了PC浏览器的效果,选项卡可以无限制增多,超出宽度会出现滚动条,本演示页面中包括...
有ajax,jquery实现tab效果
jquery ajax tab选项卡是一款通过鼠标点击导航条标签选项卡滑动切换,内容异步加载选项卡切换;简单的网页模板单页选项卡切换展示。
内容索引:脚本资源,jQuery,选项卡,Tab 基于jQuery实现的TAB选项卡,从外观上来看,与其它的选项卡没有太大差别,不过这里运用了jQuery里模拟鼠标事件的函数:trigger(type,[data]) ,在每一个匹配的元素上触发某类...
内容索引:脚本资源,jQuery,选项卡,jQuery分页,Tab 收集了几个使用jQuery制作的选项...压缩包内的几个例子就是慢慢让你明白从一个jQuery选项卡变为分页的过程,这里面要用到专一为分页而写的插件jquery.pagination.js。
内容索引:脚本资源,jQuery,Tab,选项卡,jQuery标签 实用于jquery的TabControl类动态创建选项卡【标签】,实例中用TabControl类创建了两人个实用的TAB,并加注了丰富的注释,这里要注意一下,第2个tab测试两个之间的...
摘要:脚本资源,Ajax/JavaScript,Tab,选项卡 基于CSS3+JQuery制作实现的一款简单的Tab选项卡,采用圆滑边角的风格设计,既简洁又漂亮,且兼容IE8及以上浏览器,有需要网页选项卡的朋友不妨下载本源码。
实现了获取评论无刷新,发表评论无刷新,www.sendawangluo.com页面获取评论时显示loading加载效果jquery真的是一个非常优秀的JS库,简单容易掌握,对于网页中的多级菜单、级联效果、Tab选项卡切换、图片轮转显示,...
内容索引:脚本资源,jQuery,选项卡,Tab,网页选项卡 基于jQuery的一套多功能选项卡Tab,选项卡项目可以无限制增多,超出宽度会出现滚动条,很好的支持中文;演示程序分别有滑动式选项卡,也就是滑动门;还有标准选项...
内容索引:脚本资源,jQuery,Tab,选项卡,jQuery插件 jQuery 选项卡插件,含四种激活方式,一般都包括在内了,像鼠标移上切换、点击切换,Ajax方式切换等,核心 组件是jQuery家庭的新成员,有兴趣查看示例程序。
内容索引:脚本资源,Ajax/JavaScript,jQuery jQuery 动感的网页Tab选项卡导航,不但设计精美,而且还是动感变化的,鼠标点一下上边的标签,它会不断的切换,自适应高度,我觉得真不错。
内容索引:脚本资源,jQuery,Tab,选项卡,网页标签 黑金钢 jQuery 动感Tab选项卡,在切换的时候有动画效果,附有那几个按钮的源文件,每点一个上边的按钮,下面的内容就动态切换。
一个使用jquery库写的可以复用的Tab页选项卡。 有相应注释。附带一个HTML例子。
内容索引:脚本资源,jQuery,Tab,选项卡,仿Flash jQuery Tab选项卡,有点像Flash一样的动画切换效果,整体设计看上去很大气,没有点击的时候自动播放,淡入淡出渐变,整体风格适合企业网站使用,可以用在网页上部展示...