我有以下内容:
function checkPalindrom(palindrom)
{
for( var i = palindrom.length; i > 0; i-- )
{
if( palindrom[i] = palindrom.charAt(palindrom.length)-1 )
{
document.write('the word is palindrome.');
}else{
document.write('the word is not palindrome!');
}
}
}
checkPalindrom('wordthatwillbechecked');
Run Code Online (Sandbox Code Playgroud)
我的代码出了什么问题?我想检查这个词是否是回文.
我有一个文件夹,我保存我的图像,命名img/.我有一张包含所有图像的表格:
<table border="3">
<tr>
<td>
<?php
$files = glob("img/*");
foreach ($files as $file) {
echo "<div class='divimages'>";
echo '<img src="'.$file.'"/>';
echo "<input type='submit' value='Delete image'/><br>";
echo "</div>";
}
?>
</td>
</tr>
</table>
Run Code Online (Sandbox Code Playgroud)
如何删除与按钮关联的图像,其值为:"Delete image".
我不知道这是否可能在CSS中,我相信它可以在js中完成,但我不知道如何...
我有一个带背景的div和一个带有另一个背景的另一个div的文本.我想要的是文本是透明的,并将第一个背景作为文本背景.我不知道这是否清楚,所以我为此创造了一个小提琴:
<div id="first-background">
<div id="second-background">
<h1>This text should be transparent and have the first-background as its background and ignore the second background.</h1>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
大家好我有以下脚本:
$(document).ready(function () {
$('.shoppers-images ul li').click(function () {
$('.shoppers-images ul li').removeClass('selected');
$(this).addClass('selected');
});
});
Run Code Online (Sandbox Code Playgroud)
这是我希望的...但我确信css是错误的,因为它覆盖了一些声明的值..并且.selected类永远不会显示
#foot-transport{
background: url(../img/css/register-runner.png) no-repeat;
background-position: center center;
margin-right: 20px;
}
#bicycle-transport{
background: url(../img/css/register-bycicle.png) no-repeat;
background-position: center center;
}
#van-transport{
background: url(../img/css/register-van.png) no-repeat;
background-position: center center;
margin-left: 20px;
}
.selected{
background: url(../img/css/checked-image.png) no-repeat;
background-position: center center;
}
Run Code Online (Sandbox Code Playgroud)
这是我的HTML:
<div class="span7 shoppers-images">
<ul>
<a href="#"><li id="foot-transport"><span>Individual</span></li></a>
<a href="#"><li id="bicycle-transport"><span>Pro Driver/Courier</span></li></a>
<a href="#"><li id="van-transport"><span>A Delivery </span></li></a>
</ul>
</div>
Run Code Online (Sandbox Code Playgroud)
问题是:如何在css中声明我的"选定"类,以便它更强大?
在CodeIgniter中检索最后一行(按id排序desc)的正确方法是什么?我试过select_max但我想要整排.
function getLastPagination(){
$data = array();
$this->db->query("SELECT id,sort FROM pagination GROUP BY id DESC LIMIT 1");
$query = $this->db->get('pagination');
$data = $query->row_array();
return $data;
}
$data['allpag'] = $this->Model_cats->getLastPagination();
$data['pagin'] = $data['allpag']['sort'];
$per_page = $data['pagin'];
Run Code Online (Sandbox Code Playgroud)
这里我得到第一个值,但我想要最后一行.
大家好我有以下..
.selected2:first-child{
background: url(../img/css/first-selected.png) no-repeat !important;
background-position: center center !important;
box-shadow: inset 1px 1px 5px 2px rgba(221,221,221,1) !important;
}
.selected2{
background: url(../img/css/second-selected.png) no-repeat !important;
background-position: center center !important;
box-shadow: inset 1px 1px 5px 2px rgba(221,221,221,1) !important;
}
.selected2:last-child{
background: url(../img/css/third-selected.png) no-repeat !important;
background-position: center center !important;
box-shadow: inset 1px 1px 5px 2px rgba(221,221,221,1) !important;
}
Run Code Online (Sandbox Code Playgroud)
它在ie9,chrome,opera,firefox中工作得很完美......但在ie8中我只得到每个li元素的第二个背景.
问题是什么?ie8不支持第一个孩子?