我们有一个链接:
<a href="#">
Some text
<span style="width: 50px; height: 50px; background: url(image.png); overflow: hidden; opacity: 0;"></span>
</a>
Run Code Online (Sandbox Code Playgroud)
<span>当链接悬停时,我们希望通过一些动画改变不透明度.
我们怎么做?
脚本添加id为块,给出:
<div id="some">Text</div>
Run Code Online (Sandbox Code Playgroud)
在该页面之后应跳转id,没有动画,就像我们#some在当前页面链接上有目标一样.
这该怎么做?
谢谢.
有<dl>有padding-top
<dl id="posters" style="padding-top: 150px;">
<dt class="active">text</dt>
<dd class="active"><a href="#"><img width="150" height="150" src="..." /></a></dd>
<dt>text 2</dt>
<dd><a href="#"><img width="150" height="250" src="..." /></a></dd>
<dt>text 3</dt>
<dd><a href="#"><img width="150" height="350" src="..." /></a></dd>
</dl>
Run Code Online (Sandbox Code Playgroud)
图像之间的区别 - height.
试图写一个脚本,它会改变height的<dl>,当<dd>点击时.
高度应取自该height属性 dd img.
试过这个,但没有运气:
$("#posters dt").click(function(){
var parent_padding = $("dd").find("img").height();
$("dd").closest("dl").css("padding-top",parent_padding);
}).andSelf().addClass("active")});
Run Code Online (Sandbox Code Playgroud)
谢谢.
搜索脚本,可以在没有框架的情况下显示/隐藏功能.
就像是:
<span rel="toggle" href="/somelink.html">Title</span>
<div class="toggle">Hidden block</div>
.toggle { display: none; }
Run Code Online (Sandbox Code Playgroud)
.toggle单击后应显示阻止span.就像toggle()在jQuery上一样.
谢谢.
有一个链接title和一些value:
<a href="http://site.com/someid/" title="Use ctrl + >">next</a>
Run Code Online (Sandbox Code Playgroud)
如何找到这个链接并将其href属性抛给某些人variable?
此脚本适用于除Chrome浏览器之外的所有浏览器.
$(document).ready(function(){
$(".banners-anim img").each(function(){
var hover_width = $(this).width();
var hover_height = $(this).height();
var unhover_width = (hover_width - 30);
$(this).width(unhover_width);
var unhover_height = $(this).height();
$(this).closest("li").height(unhover_height);
var offset = "-" + ((hover_height - unhover_height)/2) + "px";
$(this).closest("span").css({'position':'absolute', 'left':'0', 'top':'25px', 'width':'100%'});
$(this).hover(function(){
$(this).animate({width: hover_width, marginTop: offset}, "fast")
},function(){
$(this).animate({width: unhover_width, marginTop: 0}, "fast")
});
});
});
Run Code Online (Sandbox Code Playgroud)
Chrome无法识别已更改的图像属性.
当widthimg改变时,height也会发生变化.即使不在Chrome中 ..
$(this).width(unhover_width);
var unhover_height = $(this).height();
Run Code Online (Sandbox Code Playgroud)
unhover_height给0.
这个脚本的完整代码(包括html) - http://jsfiddle.net/BsqTe/
请帮忙解决这个问题.
谢谢.
有两个数组,$link来自foreach.一次$link必须是第一个箭头,第三个 - 第二个.所以:
1个数组:
Array (
[width] => 800
[height] => 1142
[hwstring_small] => height='96' width='67' [file] => 2010/04/white-1051279.jpg
[sizes] => Array (
[thumbnail] => Array ( [file] => white-1051279-100x150.jpg [width] => 100 [height] => 150 )
[medium] => Array ( [file] => white-1051279-200x285.jpg [width] => 200 [height] => 285 )
)
[image_meta] => Array ( [aperture] => 0 [credit] => [camera] => [caption] => [created_timestamp] => 0
[copyright] => [focal_length] => 0 [iso] …Run Code Online (Sandbox Code Playgroud) 这意味着" 如果存在 "
if($.cookie("movies_list")) {
// do something
}
Run Code Online (Sandbox Code Playgroud)
如何在不改变结构的情况下编写" 如果不存在 "?
这是html:
<a href="http://site.com/any/different/folders/picture_name.jpg">Go and win</a>
<a href="http://site.com/not/similar/links/some_other_name.png">Go and win</a>
Run Code Online (Sandbox Code Playgroud)
如何添加一些文字去年之后"/"的href属性(之前picture_name.jpg的各个环节)?
脚本应该给出类似的东西:
<a href="http://site.com/any/different/folders/user_picture_name.jpg">Go and win</a>
<a href="http://site.com/not/similar/links/user_some_other_name.png">Go and win</a>
Run Code Online (Sandbox Code Playgroud)
这user_是补充.
每个链接都是 var img_link
可以有任何长度的链接.
这是html:
<a href="http://site.com/any/different/folders/picture_name.jpg">Go and win</a>
<a href="http://site.com/not/similar/links/some_other_name.png">Go and win</a>
Run Code Online (Sandbox Code Playgroud)
如何从中删除所有数据a href,除了picture_name.jpg?可以有任何长度的链接,我们必须从最后/到最后的值"
而有人不知道要比较,如果最短的方式alt和title流通环节的相等?
谢谢.
HTML:
<body>
<div class="top-corner"></div> <!-- absolute, top: 0 -->
<div class="bottom-corner"></div> <!-- absolute, bottom: 0 -->
<a href="#" class="top-link">top</a> <!-- fixed, top 50%, left 0 -->
<a href="#" class="bottom-link">bottom</a> <!-- fixed, top 60%, left 0 -->
<div style="padding: 1500px 0;"></div> <!-- for scroll test -->
</body>
Run Code Online (Sandbox Code Playgroud)
使用scrollto插件 http://demos.flesler.com/jquery/scrollTo/
JS
$(".top-link").hover(function(){
$("body").scrollTo($(".top-corner"), 3000);
},function(){
// stop on unhover
});
$(".bottom-link").hover(function(){
$("body").scrollTo($(".bottom-corner"), 3000);
},function(){
// stop on unhover
});
Run Code Online (Sandbox Code Playgroud)
动画在悬停时起作用.怎么停止它?
谢谢.
脚本将rel属性替换为class.
完整代码 - http://jsbin.com/efozi3/8/
它不适用于使用超过2个值的链接rel.
一个例子 - 第一项:
<a class="s1" rel="t1 t2 t3" href="#">One</a>
Run Code Online (Sandbox Code Playgroud)
前三个 <li> 应该变成蓝色,但现在只有第一个变成蓝色.
<li class="t1">
<strong>1</strong>
</li>
<li class="t2">
<strong>2</strong>
</li>
<li class="t3">
<strong>3</strong>
</li>
Run Code Online (Sandbox Code Playgroud)
此行无法按预期工作(支持最多2个值rel):
return $('.' + elem.rel.replace(' ', ', .'));
Run Code Online (Sandbox Code Playgroud)
您可以直接在http://jsbin.com/efozi3/8/edit/上编辑代码
谢谢.