图片特效代码(特效代码大全)
admin 发布:2022-12-19 23:04 101
本篇文章给大家谈谈图片特效代码,以及特效代码大全对应的知识点,希望对各位有所帮助,不要忘了收藏本站喔。
本文目录一览:
- 1、HTML轮播图片代码,带解释
- 2、DW图片切换代码(特效,简单,容改)
- 3、鼠标悬停特效代码怎么写,鼠标放在小图片上旁边显示一张大图片?
- 4、我是小白。。最近写一个图片轮播特效的代码,html和css部分都已经写好了,而js部分怎么也不会写
HTML轮播图片代码,带解释
!DOCTYPE HTML
html
head
meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /
title五图三屏轮播js特效代码/title
meta name="Keywords" content="五图三屏轮播js特效代码" /
meta name="description" content="五图三屏轮播js特效代码" /
link href="" type="text/css" rel="Stylesheet" /
link href="/style/style_kj.css" type="text/css" rel="stylesheet" /
link href="/style/demo.css" type="text/css" rel="stylesheet" /
script type="text/javascript" src="/style/js/jquery-1.2.pack.js"/script
script type="text/javascript"
var theme_list_open = false;
$(document).ready(function () {
function fixHeight() {
var headerHeight = $("#switcher").height();
$("#iframe").attr("height", $(window).height()-84 + "px");
}
$(window).resize(function () {
fixHeight();
}).resize();
//响应式预览
$('.icon-monitor').addClass('active');
$(".icon-mobile-3").click(function () {
$("#by").css("overflow-y", "auto");
$('#iframe-wrap').removeClass().addClass('mobile-width-3');
$('.icon-tablet,.icon-mobile-1,.icon-monitor,.icon-mobile-2,.icon-mobile-3').removeClass('active');
$(this).addClass('active');
return false;
});
$(".icon-mobile-2").click(function () {
$("#by").css("overflow-y", "auto");
$('#iframe-wrap').removeClass().addClass('mobile-width-2');
$('.icon-tablet,.icon-mobile-1,.icon-monitor,.icon-mobile-2,.icon-mobile-3').removeClass('active');
$(this).addClass('active');
return false;
});
$(".icon-mobile-1").click(function () {
$("#by").css("overflow-y", "auto");
$('#iframe-wrap').removeClass().addClass('mobile-width');
$('.icon-tablet,.icon-mobile,.icon-monitor,.icon-mobile-2,.icon-mobile-3').removeClass('active');
$(this).addClass('active');
return false;
});
$(".icon-tablet").click(function () {
$("#by").css("overflow-y", "auto");
$('#iframe-wrap').removeClass().addClass('tablet-width');
$('.icon-tablet,.icon-mobile-1,.icon-monitor,.icon-mobile-2,.icon-mobile-3').removeClass('active');
$(this).addClass('active');
return false;
});
$(".icon-monitor").click(function () {
$("#by").css("overflow-y", "hidden");
$('#iframe-wrap').removeClass().addClass('full-width');
$('.icon-tablet,.icon-mobile-1,.icon-monitor,.icon-mobile-2,.icon-mobile-3').removeClass('active');
$(this).addClass('active');
return false;
});
});
/script
script type="text/javascript"
function Responsive($a) {
if ($a == true) $("#Device").css("opacity", "100");
if ($a == false) $("#Device").css("opacity", "0");
$('#iframe-wrap').removeClass().addClass('full-width');
$('.icon-tablet,.icon-mobile-1,.icon-monitor,.icon-mobile-2,.icon-mobile-3').removeClass('active');
$(this).addClass('active');
return false;
};
/script
/head
body id="by" style="overflow-y: hidden"
div id="switcher"
div class="center"
ul
li class="logoTop"在线预览!/li
div id="Device"
li class="device-monitor"a href="javascript:"div class="icon-monitor"/div/a/li
li class="device-mobile"a href="javascript:"div class="icon-tablet" /div/a/li
li class="device-mobile"a href="javascript:"div class="icon-mobile-1" /div/a/li
li class="device-mobile-2"a href="javascript:"div class="icon-mobile-2" /div/a/li
li class="device-mobile-3"a href="javascript:"div class="icon-mobile-3" /div/a/li
/div
/ul
div class="muen_top"
a href="/" class="indexactive"首页/a
a href="/tupian/" class="l11active" target="_blank"高清图片/a
a href="/moban/" class="l12active" target="_blank"模板/a
a href="/ppt/" class="l726active" target="_blank"ppt模板/a
a href="/tubiao/" class="l49active" target="_blank"图标/a
a href="/kuzhan/" class="l713active" target="_blank"酷站/a
a href="" class="l13active" target="_blank"字体/a
a href="/psd/" class="l713active" target="_blank"PSD素材/a
a href="/shiliang/" class="l15active" target="_blank"矢量图/a
a href="/yinxiao/" class="l713active" target="_blank"音效/a
a href="/biaoqing/" class="l560active" target="_blank"表情/a
a href="" class="l713active" target="_blank"壁纸/a
a href="/donghua/" class="l653active" target="_blank"动画/a
a href="/jiaoben/" target="_blank"脚本/a
a href="/zhuanti/" target="_blank"专题/a
/div
div class="tougao"
a href="" target="_blank"我要投稿/a
/div
/div
/div
div id="iframe-wrap"
iframe id="iframe" src="" frameborder="0" width="100%" /iframe
/div
div id="footer-notice" class="kj_bottom"
div style=" width:980px; margin:0 auto"
p class="left cut"
span名称:/span
a href="/jiaoben/160419378420.htm" title="点击下载" class="down" target="_blank"五图三屏轮播js特效代码/a
span类型:/span
a href="/jiaoben/" title="脚本" target="_blank"脚本/a
span标签:/spana href="/tag_jiaoben/js.html" target="_blank"js/aa href="/tag_jiaoben/JiuGongGe.html" target="_blank"九宫格/aa href="/tag_jiaoben/TuPianQieHuan.html" target="_blank"图片切换/aa href="/tag_jiaoben/TuPianLunBo.html" target="_blank"图片轮播/a
/p
p class="left"
span分享到:/span
a title='分享到新浪微博' href="javascript:void(0)" id="fxwb" class="sn"新浪/a
a title='分享到腾讯微博' href='javascript:void(0)' onclick=posttoWb() class="tx"腾讯/a
a title="分享到QQ空间" href="javascript:window.open(''+encodeURIComponent(document.location.href));void(0)" class="qq"QQ空间/a
/p
div class="clear"/div
/div
/div
script type="text/javascript"
var description = '五图三屏轮播js特效代码: 五图三屏轮播js特效代码是一款ZHIME织蜜内衣丝袜五图三屏图片切换特效。';
var sendT = {
getHeader: function () {
var g_title = description;
var re = /[^]*?font[^]*?/gi;
g_title = g_title.replace(re, "");
return g_title;
},
getFirstImgSrc: function () {
var allPageTags = document.getElementsByTagName("div");
for (var i = 0; i allPageTags.length; i++) {
if (allPageTags[i].className == 'downtext') {
if (allPageTags[i].getElementsByTagName("img")[0] allPageTags[i].getElementsByTagName("img")[0].width 200) {
return allPageTags[i].getElementsByTagName("img")[0].src;
}
else {
return null;
}
}
}
},
getContent: function () {
var allPageTagss = document.getElementsByTagName("div");
for (var i = 0; i allPageTagss.length; i++) {
if (allPageTagss[i].className == 'downtext') {
return allPageTagss[i].innerHTML;
}
}
}
}
document.getElementById("fxwb").onclick = function () {
(function (s, d, e, r, l, p, t, z, c) {
var f = ';', u = z || d.location, p = ['url=', e(u), 'title=', e(sendT.getHeader()), 'source=', e(r), 'sourceUrl=', e(l), 'content=', c || 'gb2312', 'pic=', e(p || '')].join('');
function a() {
if (!window.open([f, p].join(''), 'mb', ['toolbar=0,status=0,resizable=1,width=440,height=430,left=', (s.width - 440) / 2, ',top=', (s.height - 430) / 2].join(''))) u.href = [f, p].join('');
};
if (/Firefox/.test(navigator.userAgent)) setTimeout(a, 0); else a();
})(screen, document, encodeURIComponent, 'CHINAZ', '', sendT.getFirstImgSrc(), null, null, null);
}
function posttoWb() {
var _tt = description;
var _t = encodeURI(_tt.replace(/\s+$/, ''));
var _url = encodeURI(window.location);
var _appkey = encodeURI("258efff116d2466da9b7513cbae7de0b");
var _site = encodeURI('sc.chinaz.com');
var _pic = sendT.getFirstImgSrc();
var _u = '' + _t + 'url=' + _url + 'appkey=' + _appkey + 'site=' + _site + 'pic=' + _pic;
window.open(_u, '转播到腾讯微博', 'width=700, height=580, top=320, left=180, toolbar=no, menubar=no, scrollbars=no, location=yes, resizable=no, status=no');
}
/script
script type="text/javascript" src="/js/softinfo.js.aspx?id=534084" defer="defer" charset="UTF-8"/script
div style="display:none"
script src=";web_id=300636" language="JavaScript"/script
/div
/body
/html
自己修改一下就可以了
DW图片切换代码(特效,简单,容改)
将以下代码插入到你的网页你需要图片切换的地方
script type="text/javascript"
imgUrl1="img/1.jpg";(图片路径和图片名称,修改一下)
imgUrl2="img/2.jpg";
imgUrl3="img/3.jpg";
imgUrl4="img/4.jpg";
imgUrl5="img/5.jpg";
var focus_width='400'(图片宽度)
var focus_height='300'(图片高度)
var text_height='|||'
var swf_height = focus_height
var pics=imgUrl1+"|"+imgUrl2+"|"+imgUrl3+"|"+imgUrl4+"|"+imgUrl5
document.write('object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="" width="'+ focus_width +'" height="'+ swf_height +'"');
document.write('param name="allowScriptAccess" value="sameDomain"param name="movie" value=""param name="quality" value="high"param name="bgcolor" value="#F0F0F0"');
document.write('param name="menu" value="false"param name=wmode value="opaque"');
document.write('param name="FlashVars" value="pics='+pics+'borderwidth='+focus_width+'borderheight='+focus_height+'"');
document.write('embed src="pixviewer.swf" wmode="opaque" FlashVars="pics='+pics+'borderwidth='+focus_width+'borderheight='+focus_height+'" menu="false" bgcolor="#F0F0F0" quality="high" width="'+ focus_width +'" height="'+ focus_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="" /'); document.write('/object');
/script
鼠标悬停特效代码怎么写,鼠标放在小图片上旁边显示一张大图片?
代码有bug,修改后如下:
需要注意,拷贝下面这段代码,保存为 html后缀名的文件;需要自己在相同的目录下,放置两张图片,小图片.jpg 大图片.jpg
效果如下图:当鼠标悬停在小图片上面的时候,会显示大图片;鼠标移出,隐藏大图片。
问题:定位需要读者自己去实现一下吧,偷懒了。感谢楼上分享!
!doctype html
html
head
meta charset=utf-8
/head
body
你要显示特效的html
img src="小图片.jpg" width="200px" height="200px" id="littleimg" onmouseout="hoverHiddendiv()" onmouseenter="hoverShowDiv()" /
div style="width:200px;height:80px;border:1px solide #aaccff;display:none;" id="divHover"
大图片显示如下
img src="大图片.jpg" width="500px" height="300px" id="bigimg" /
/div
script type="text/javascript"
let divHover = document.getElementById("divHover");
function hoverShowDiv() {
console.log("显示大图片");
divHover.style.display = "block";
divHover.style.top = document.getElementById("littleimg").style.top + 10;
divHover.style.left = document.getElementById("littleimg").style.left + 10;
}
function hoverHiddendiv() {
console.log("显示小图片");
divHover.style.display = "none";
}
/script
/body
/html
我是小白。。最近写一个图片轮播特效的代码,html和css部分都已经写好了,而js部分怎么也不会写
这么给你说吧 JS你最好放在body的最下面
因为你写在head里 在dom加载完成前 你的JS就执行完了
或者你在最外层加上
$(document).ready(function(){
//你的代码
}
但是还是建议你将JS代码放在body内的最下面
图片特效代码的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于特效代码大全、图片特效代码的信息别忘了在本站进行查找喔。
版权说明:如非注明,本站文章均为 AH站长 原创,转载请注明出处和附带本文链接;
- 上一篇:图片墙滚动代码(滚动 图片)
- 下一篇:画纵向横向圆代码(纵向图怎么画)
相关推荐
- 05-06个人主页图片代码(个人主页图片代码怎么弄)[20240506更新]
- 05-06css特效代码大全1(css字体特效代码)[20240506更新]
- 05-06表白css特效代码(html520表白代码)[20240506更新]
- 05-06全屏图片上下滚动代码(全屏图片上下滚动代码怎么设置)[20240506更新]
- 05-06搜索网站的代码(搜索网站的代码大全)[20240506更新]
- 05-06js页面左右滑动特效代码(js滚动特效)[20240506更新]
- 05-05网页图片位置代码(网页设计中图片的位置)[20240505更新]
- 05-05bootstrap图片特效代码(bootstrap图标怎么用)[20240505更新]
- 05-05discuz代码模式(discuz代码大全)[20240505更新]
- 05-05网页动画话图片特效代码(网页文字动画)[20240505更新]
取消回复欢迎 你 发表评论:
- 标签列表
- 最近发表
- 友情链接