Table of Contents
回复讨论(解决方案)
Home Web Front-end HTML Tutorial 从js代码网站找到有滑动切换内容的代码怎么套进去实际应用?在线急等_html/css_WEB-ITnose

从js代码网站找到有滑动切换内容的代码怎么套进去实际应用?在线急等_html/css_WEB-ITnose

Jun 24, 2016 am 11:29 AM

我在js代码特效网站,找到一个鼠标滑动切换内容的代码,但是怎样把这个代码套进去网站,实际来应用呢?

做成图片上面这张可以实际应用 来切换的   


回复讨论(解决方案)

图片上网站的例子网址:tzrlfk  前面www.  和.com  不知道能不能发网址  

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>1111</title><style>*{ margin:0; padding:0; list-style:none;}body{ font-size:12px; color:#666; text-align:left;}h1{ text-align:center;}.lanrenzhijia{ width:348px; height:230px; margin:100px auto; background:#f0f0f0; font-family:'微软雅黑';}.lanrenzhijia .tab{ overflow:hidden; background:#ccc;}.lanrenzhijia .tab a{ display:block; width: 74px; height: 26px; float:left; text-decoration:none; color:#333;text-align: center;    line-height: 26px;    margin-left: 6px; }.lanrenzhijia .tab a:hover{ background:#E64E3F; text-decoration:none;}.lanrenzhijia .tab a.on{ background:#E64E3F;color: #740062; text-decoration:none;background:url(images/xk.jpg)no-repeat;}.lanrenzhijia .content{ overflow:hidden; width:348px; height:204px;}.lanrenzhijia .content li{ display:none;}</style></head><body><div class="lanrenzhijia">	<div class="tab">    	<a href="javascript:;" class="on">人流检查</a>        <a href="javascript:;">早孕检测</a>        <a href="javascript:;">人工引产</a>        <a href="javascript:;">人流康复</a>    </div>    <div class="content">    	        	<li style="display:block;">无痛人流后多久完全康复</li>            <li>flash素材内容</li>            <li>亚当学院内容</li>            <li>在线客服代码内容</li>           </div></div><script src="http://www.lanrenzhijia.com/ajaxjs/jquery.min.js"></script><script>$(function(){	$(".lanrenzhijia .tab a").mouseover(function(){		$(this).addClass('on').siblings().removeClass('on');		var index = $(this).index();		number = index;		$('.lanrenzhijia .content li').hide();		$('.lanrenzhijia .content li:eq('+index+')').show();	});		var auto = 2;  //等于1则自动切换,其他任意数字则不自动切换	if(auto ==1){		var number = 0;		var maxNumber = $('.lanrenzhijia .tab a').length;		function autotab(){			number++;			number == maxNumber? number = 0 : number;			$('.lanrenzhijia .tab a:eq('+number+')').addClass('on').siblings().removeClass('on');			$('.lanrenzhijia .content  li:eq('+number+')').show().siblings().hide();		}		var tabChange = setInterval(autotab,3000);		//鼠标悬停暂停切换		$('.lanrenzhijia').mouseover(function(){			clearInterval(tabChange);		});		$('.lanrenzhijia').mouseout(function(){			tabChange = setInterval(autotab,3000);		});	  }});</script></body></html>
Copy after login

上面是在js代码网站找到的 切换功能的代码 怎么套进去呢 请问

http://www.17sucai.com/pins/12047.html

http://www.juheweb.com/js/tab/71.html

http://www.51xuediannao.com/js/jquery/656.html

楼上那位大神  我知道这种代码 我有很多 但是不知道怎么套进去 实际应用啊 

它这个好像不止是需要改变样式 连调用的对应js 都要修改才可以吧

看懂代码,你就能套进去了。js里面都有注释的,你稍微读一读,理解一下,就当学习新的东西了,这样你也会有进步的~

我真的套了很久很久,我把样式改好了,但是js不管用了,不能切换内容,

我真的套了很久很久,我把样式改好了,但是js不管用了,不能切换内容,


注意它jquery选择器的样式名,只要你不改结构和样式名称,都没什么问题,直接改样式就行


我真的套了很久很久,我把样式改好了,但是js不管用了,不能切换内容,


注意它jquery选择器的样式名,只要你不改结构和样式名称,都没什么问题,直接改样式就行
我就是要改切换内容那部分的结构 它jquery里面只是调用li标签  可我要用到好几个div 我把页面实现了 它却不会滑动了

没人可以帮我吗。

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Will R.E.P.O. Have Crossplay?
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What is the purpose of the <progress> element? What is the purpose of the <progress> element? Mar 21, 2025 pm 12:34 PM

The article discusses the HTML &lt;progress&gt; element, its purpose, styling, and differences from the &lt;meter&gt; element. The main focus is on using &lt;progress&gt; for task completion and &lt;meter&gt; for stati

What is the purpose of the <datalist> element? What is the purpose of the <datalist> element? Mar 21, 2025 pm 12:33 PM

The article discusses the HTML &lt;datalist&gt; element, which enhances forms by providing autocomplete suggestions, improving user experience and reducing errors.Character count: 159

What is the purpose of the <meter> element? What is the purpose of the <meter> element? Mar 21, 2025 pm 12:35 PM

The article discusses the HTML &lt;meter&gt; element, used for displaying scalar or fractional values within a range, and its common applications in web development. It differentiates &lt;meter&gt; from &lt;progress&gt; and ex

What is the viewport meta tag? Why is it important for responsive design? What is the viewport meta tag? Why is it important for responsive design? Mar 20, 2025 pm 05:56 PM

The article discusses the viewport meta tag, essential for responsive web design on mobile devices. It explains how proper use ensures optimal content scaling and user interaction, while misuse can lead to design and accessibility issues.

What is the purpose of the <iframe> tag? What are the security considerations when using it? What is the purpose of the <iframe> tag? What are the security considerations when using it? Mar 20, 2025 pm 06:05 PM

The article discusses the &lt;iframe&gt; tag's purpose in embedding external content into webpages, its common uses, security risks, and alternatives like object tags and APIs.

Is HTML easy to learn for beginners? Is HTML easy to learn for beginners? Apr 07, 2025 am 12:11 AM

HTML is suitable for beginners because it is simple and easy to learn and can quickly see results. 1) The learning curve of HTML is smooth and easy to get started. 2) Just master the basic tags to start creating web pages. 3) High flexibility and can be used in combination with CSS and JavaScript. 4) Rich learning resources and modern tools support the learning process.

The Roles of HTML, CSS, and JavaScript: Core Responsibilities The Roles of HTML, CSS, and JavaScript: Core Responsibilities Apr 08, 2025 pm 07:05 PM

HTML defines the web structure, CSS is responsible for style and layout, and JavaScript gives dynamic interaction. The three perform their duties in web development and jointly build a colorful website.

What is an example of a starting tag in HTML? What is an example of a starting tag in HTML? Apr 06, 2025 am 12:04 AM

AnexampleofastartingtaginHTMLis,whichbeginsaparagraph.StartingtagsareessentialinHTMLastheyinitiateelements,definetheirtypes,andarecrucialforstructuringwebpagesandconstructingtheDOM.

See all articles