我最近整理了一个工作导航栏.
我很高兴,但遗憾的是它无法访问.
当图像关闭时,我想在其位置显示替换文本.
用我的例子很容易实现这个:http://pastebin.com/hXth7FSK?
非常感谢任何指针.
迈克尔
我的网站上有2个基本的显示/隐藏链接,效果很好.
这是我的HTML:
<!DOCTYPE html>
<html lang="en">
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<script type="text/javascript" src="http://codylindley.com/blogstuff/js/jquery/jquery-base.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("input.buttonAsize").click(function(){ alert($("div.contentToChange").find("p").size()); });
$("a.codeButtonA").click(function(){$("pre.codeA").toggle()});
$("input.buttonBsize").click(function(){ alert($("div.contentToChange").find("p").size()); });
$("a.codeButtonB").click(function(){$("pre.codeB").toggle()});
});
</script>
<style type="text/css">
pre {
background: white;
overflow: auto;
display:none;
}
</style>
</head>
<body>
<a href="#" class="codeButtonA">Show / Hide</a>
<pre class="codeA">
test message 1
</pre>
<div style="background:green;margin-top:1000px">
<a href="#" class="codeButtonB">Show / Hide</a>
<pre class="codeB">
test message 2
</pre>
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
但是,当我单击页面底部的第二个链接时,它会打开<pre>标记,但随后会跳转到页面顶部.当我点击它时,有没有办法阻止它跳到页面顶部?
我更喜欢它只是显示盒子而从未跳到顶部.
非常感谢您对此的任何帮助.
我有以下一些PHP代码.
最后,我想存储<p>Michael is 26</p>在$ STR1变量,<p>He likes green cars.</p><p>And white footballs</p><p>And red lollies</p><p>And yellow suns</p>在$ STR2变量.
因此,第一段中的所有内容基本上都是$ str1,其后所有内容都是$ str2.
<?php
$str = "<p>Michael is 26</p><p>He likes green cars.</p><p>And white footballs</p><p>And red lollies</p><p>And yellow suns</p>";
$strArray = explode('</p>', $str);
$str1 = $strArray[0] . '</p> ';
echo $str1;
// variable to export remainder of string (minus the $str1 value) ?
?>
Run Code Online (Sandbox Code Playgroud)
我该如何实现这一目标?
非常感谢任何指针.
我想使用jQuery隐藏/显示子菜单.
所以最初"项目"只会是可见的.单击时,将显示子菜单.
我附上了我当前的HTML代码:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<div class="menu-primary-menu-container">
<ul id="menu-primary-menu" class="menu">
<li id="menu-item-27" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menu-item-27"><a href="#">Projects</a>
<ul>
<li id="menu-item-26" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-26"><a href="/category/projects/residential/">Residential</a></li>
<li id="menu-item-24" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-24"><a href="/category/projects/private/">Private</a></li>
</ul>
</li>
</ul>
</div>Run Code Online (Sandbox Code Playgroud)
这是我的演示:http: //jsfiddle.net/76Lr33ap/
我的网站上有以下按钮:http: //jsfiddle.net/32u5x5uf/
我首先想要将跨度圆移动到主按钮的正中心.然后,我想,如果我可以在CSS中以某种方式将两个形状"合并"在一起.所以基本上删除圆圈的上半部分和切入圆圈中间的主条.
.full-circle {
border: 2px solid #1588CB;
height: 35px;
width: 35px;
-moz-border-radius:30px;
-webkit-border-radius: 30px;
position:absolute;
bottom:-20px;
}
button {
background:#ffffff;
border-radius: 10px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border: 2px solid #1588CB;
color:#1588CB;
font-weight:400;
height:200px;
width:400px;
position:relative;
}Run Code Online (Sandbox Code Playgroud)
<button>Learn More
<span class="full-circle">+</span>
</button>Run Code Online (Sandbox Code Playgroud)
我的网站上有以下部分:http: //jsfiddle.net/4jr2r3nq/
我想,如果我将鼠标悬停在主按钮,无论是button和full-circle改变背景颜色.从该示例中可以看出,当我将鼠标悬停在主要形状上时,只会更改背景颜色,而不是半圆部分:(
.full-circle {
border: 2px solid #1588CB;
height: 35px;
width: 35px;
-moz-border-radius:30px;
-webkit-border-radius: 30px;
position:absolute;
bottom:-20px;
}
button {
background:#ffffff;
border-radius: 10px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border: 2px solid #1588CB;
color:#1588CB;
font-weight:400;
height:200px;
width:400px;
position:relative;
}
/* overides ... */
.full-circle {
border-radius: 0 0 30px 30px;
border-top: none;
height: 17px;
background: #FFF;
left: 50%;
margin-left: -17px;
bottom: -19px;
line-height: 0;
}
button:hover, .full-circle:hover {
background:red
}Run Code Online (Sandbox Code Playgroud)
<button>Learn More
<span class="full-circle">+</span>
</button>Run Code Online (Sandbox Code Playgroud)
如何调整 SVG 徽标的大小以提高移动设备的响应速度?
这是我的小提琴,我的代码如下:
body {
background:black;
}
@media screen and (max-width: 500px) {
svg {
width:50%;
}
}Run Code Online (Sandbox Code Playgroud)
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<svg version="1.1" preserveAspectRatio="xMinYMin meet" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
<title>Logo</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Your-Score" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">
<g id="Desktop-Your-Score" sketch:type="MSLayerGroup" transform="translate(-23.000000, -24.000000)" font-weight="normal" font-family="Gill Sans" letter-spacing="1.16666663" font-size="28" sketch:alignment="middle" fill="#FFFFFF">
<g id="Header" sketch:type="MSTextLayer">
<g id="Primary-Nav-[home]-Copy">
<g id="Logo" transform="translate(23.000000, 18.000000)">
<text id="TOMORROW’S">
<tspan x="0.0328778028" y="27">TOMORROW’S</tspan>
<tspan x="36.2975262" y="58">SCORE</tspan>
</text>
</g>
</g>
</g>
</g>
</g> …Run Code Online (Sandbox Code Playgroud)我一直在为我的数据表上的实时搜索解决方案.
当我搜索Jim它按预期工作:-)
但是,当我搜索时Carey,不会显示任何结果.为什么是这样?:-(
演示: http ://jsfiddle.net/L1d7naem/
$("#search").on("keyup", function() {
var value = $(this).val();
$("table tr").each(function(index) {
if (index !== 0) {
$row = $(this);
var id = $row.find("td:first").text();
if (id.indexOf(value) !== 0) {
$row.hide();
}
else {
$row.show();
}
}
});
});Run Code Online (Sandbox Code Playgroud)
table, tr, td, th{
border: 1px solid blue;
padding: 2px;
}
table th{
background-color: #999999;
}Run Code Online (Sandbox Code Playgroud)
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<table>
<tr><th>Forename</th><th>Surname</th><th>Extension</th></tr>
<tr><td>Jim</td><td>Carey</td><td>1945</td></tr>
<tr><td>Michael</td><td>Johnson</td><td>1946</td></tr>
</table>
<br />
<input type="text" id="search" placeholder=" live search"></input>Run Code Online (Sandbox Code Playgroud)
我的网站上有一个Bootstrap Carousel.
当用户将鼠标悬停在元素上时#formcontainer,我想暂停旋转木马.当我徘徊时,我想继续旋转木马的循环.第一部分可以正常使用以下代码,但不是第二部分.有人可以帮忙吗?
$(document).ready(function() {
$('.carousel').carousel({
interval: 1200,
pause: "hover"
});
$('#formcontainer').hover(function(){
$("#myCarousel4").carousel('pause');
});
});
Run Code Online (Sandbox Code Playgroud) 我在Apache服务器上使用WordPress,并希望在有人第一次登陆我的网站时使用我的.htaccess设置 cookie。
如果可能,我会将两个Cookie设置为:
通常在 PHP 中,我只有:
function set_user_cookie() {
$url = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
if (!isset($_COOKIE['LandingPageURL'])) {
setcookie('LandingPageURL', $url, time()+2678400, "/");
}
}
add_action( 'init', 'set_user_cookie');
Run Code Online (Sandbox Code Playgroud)
然而,我们一直注意到缓存问题,所以我想知道是否可以在我的.htaccess 中实现这一点。