下面是代码
HTML
<div class="fgimg">
</div>
Run Code Online (Sandbox Code Playgroud)
CSS
.fgimg {
width: 200px;
height: 200px;
-webkit-border-radius: 150px;
-moz-border-radius: 150px;
background: url('https://c1.staticflickr.com/3/2669/5830411257_b21bf9e931_b.jpg') no-repeat;
margin-left:30%;
margin-top:10px;
background-position: center center;
}
.fgimg:hover {
cursor:pointer;
border-radius: 210px;
border-color:#226fa3;
border:outset;
-webkit-border-radius: 150px;
-moz-border-radius: 150px;
Run Code Online (Sandbox Code Playgroud)
}
这是演示: http ://jsfiddle.net/sathish_opr/03kkqywy/1/
当我们将鼠标悬停在图像上时,图像位置会发生变化.
我希望在悬停时看到图像的边框颜色,但图像位置会自动更改:(
可能是什么问题呢 ?
我的 HTML 中有以下代码,其中包含多个 DIV,我想使用这些 DIV 作为选项。出于这个原因,被点击的 DIV 应该是可选的(不选择其他人 - 只有一个应该是活动的),当我点击确认链接时,所选 DIV 中的值应该显示在消息框中。
<div style="margin-top:10px;">
<div class="optionsecoptions">
Computers
</div>
<div class="optionsecoptions" style="top:151px;">
Electronics
</div>
<div class="optionsecoptions" style="top:212px;">
Mechanical
</div>
<div class="optionsecoptions" style="top:273px;">
Electrical
</div>
</div>
<a href="#"> Confirm </a>
Run Code Online (Sandbox Code Playgroud)
这是演示:
http://jsfiddle.net/sathish_opr/ntxuc69a/
我在 Jquery 中尝试了一些解决方案,但这可以使用简单的 javascript 吗?请帮忙!
我在Excel中有两个文本单元,如下所示,其中包含字符串(A1和A2),我试图从A1单元格字符串中删除A2单元格字符并将结果存储在A3中.
我尝试过使用SEARCH(),TEXT(),RIGHT()等少数函数但是无法实现我需要的结果.
我可以使用任何编程语言(Python,C等)轻松完成这项工作 - 只需要一个循环和几个字符串函数.但无法弄清楚使用Excel公式获得相同的方法.
有什么想法我们怎么能得到这个?
我试图使用下面的代码动态生成div,但新的div不包含我现有的div容器的元素.
Below is the code which I tried:
Run Code Online (Sandbox Code Playgroud)
http://jsfiddle.net/sathish_panduga/bvb7msne/2/
我们如何动态地创建我的内部div的所有元素(都来自inner1和inner2 div)到新生成的元素中,而不为现有div中的每个元素编写追加函数,我在那里缺少什么?
另外,如何删除使用按钮点击新创建的div?
$(function() {
$("#add").click(function() {
div = document.createElement('div');
$(div).addClass("inner").html("new inner div");
$("#container").append(div);
});
});
Run Code Online (Sandbox Code Playgroud)
#container {
border: 1px solid red;
width: 100%;
height: 330px;
}
.inner {
border: 1px solid green;
width: 100%;
height: 300px;
}
.inner1 {
position: relative;
width: 50%;
height: 100%;
float: left;
background: #808080;
background-color: #808080;
overflow: hidden;
}
.inner2 {
position: relative;
width: 50%;
height: 100%;
float: left;
background: green;
background-color: green;
overflow: hidden; …
Run Code Online (Sandbox Code Playgroud)