我有这个代码:
$('a[rel="imagesHandler"]').hover(
function(){
//ia latimea
var liWidth = $(this).width();
$(this).append('<div id="editBar"><a id="delPic" href="#"><img id ="piDe"src="./images/pic_del_icon.png" alt="" /></a></div>');
$('div#editBar')
.css({ 'width':liWidth - 3,
'height':'19px',
'padding-left':'3px',
'padding-top':'1px',
'float':'left',
'position':'relative',
'top':'-22px',
'z-index':200,
'background-color':'black',
'opacity':'0.5'
})
.hide()
.fadeIn('slow');
$('a#delPic').click(function(event){
event.stopPropagation();
alert('gigi');
return false;
});
},
function(){
$('div#editBar').hide('slow');
$('div#editBar').remove();
}
);
Run Code Online (Sandbox Code Playgroud)
所以,我追加到鼠标悬停时弹出,在这个div中是#delPic.我将div#editBar的不透明度更改为0.5,但它也适用于#delPic.所以,我想将#delPic不透明度改回1.我该怎么做?我试过一些版本.这就是为什么我最终把那个id放到锚点上(试图直接选择它),但仍然不起作用.
我有这样的文件夹结构:
/articles
.index.php
.second.php
.third.php
.fourth.php
Run Code Online (Sandbox Code Playgroud)
如果我在second.php中编写代码,我该如何扫描当前文件夹(文章)?
谢谢
我想要做的是在移动列表项后返回移动的li包含的文本.有没有办法做到这一点?谢谢
编辑:
我试过了$(ui.item).text()但是我得到了一个ui is not defined error(我只是进口了jquery.js,ui.core.js而且ui.sortable.js,我是否必须导入别的东西?)
HTML
<ul id="sortable">
<li><a href="" class="drag">text</a></li>
<li><a href="" class="drag">another text</a></li>
<li><a href="" class="drag">more text</a></li>
</ul>
Run Code Online (Sandbox Code Playgroud)
JS
$(document).ready(function(){
$('ul#sortable').sortable({
handle:'.drag',
axis:'y',
update:function(){
alert($(ui.item).text());
}
});
});
Run Code Online (Sandbox Code Playgroud) 我有这个数组:
Array
(
0 => "3_some val",
1 => "1_some other val",
2 => "0_val",
3 => "2_value",
4 => "4_other value"
)
Run Code Online (Sandbox Code Playgroud)
考虑到上面的数组,有没有办法从这样的数组做?
Array
(
0 => "val",
1 => "some other val",
2 => "value",
3 => "some val",
4 => "other value"
)
Run Code Online (Sandbox Code Playgroud)
实际上强制在下划线之前的数字是(_)新创建的数组中的键.谢谢
<ul>
<li>one</li>
<li>element</li>
<li>text</li>
<li>val</li>
</ul>
Run Code Online (Sandbox Code Playgroud)
我怎样才能获得ul点击的位置li?
可以从其他服务器导入css文件吗?假设我在www.mysite.com上有我的html,我可以像这样导入我的CSS吗?
<link href="www.anothersite.com/style.css" rel="stylesheet" type="text/css" />
Run Code Online (Sandbox Code Playgroud) 我有两个文件:(localhost/template /)
index.php
template.php
Run Code Online (Sandbox Code Playgroud)
每当我创建一篇文章(文章系统是我正在尝试做的),我创建一个文件夹,然后我复制该文件夹中的index.php.我想在index.php中包含模板php但是作为静态url('因为文章将像文件夹子文件夹/子文件夹/ ..结构)
我试过了:include('localhost/template/template.php')没有结果.我应该如何包括它?谢谢