我在一个表中放置了一个WYSIWYG编辑器,它放在一个div中,因此......
<div class="mydiv">
<li>
<table>My WYSIWYG</table>
</li>
</table>
Run Code Online (Sandbox Code Playgroud)
在我的WYSIWYG内部有更多的表,但是我只想要定位第一个表,我知道我可以为表分配一个类,但那不是我想要的.
我尝试使用以下只是它似乎没有工作...
.mydiv li + table {width:100%;}
Run Code Online (Sandbox Code Playgroud) 我在使用 @font-face 选择器时遇到了一些麻烦,我有以下问题...
@font-face {
font-family: 'MuseoSans-700';
src: url('http://mysite.co.uk/clients/reload/Images/style_159306.eot');
src: url('http://mysite.co.uk/clients/reload/Images/style_159306.eot?#iefix') format('embedded-opentype'),
url('style_159306.woff') format('woff'),
url('style_159306.ttf') format('truetype');
}
Run Code Online (Sandbox Code Playgroud)
只有我的字体没有被渲染,而是显示了我的后备字体,arial。
如果我将字体的 url 粘贴到我的浏览器中,它会要求我下载,所以我知道链接是正确的,我在上面做错了什么吗?
我调用字体使用...
h1 {
color:#272727;
font:108px 'MuseoSans-700',Helvetica,Arial,sans-serif;
letter-spacing:-7px;
}
Run Code Online (Sandbox Code Playgroud)
谢谢
我的页面上有一个元素绝对定位.
我试图编写一个jQuery片段,使该元素以比页面上其他元素更慢的速度滚动.
到目前为止我写过这个,但似乎根本无法完成它.有没有人有这方面的经验,你是否愿意解释?
$(document).ready(function() {
$window = $(window);
$('.twit-bird').css({
'top' : -($('window')/3)+"px"
});
});
Run Code Online (Sandbox Code Playgroud)
我还尝试在我的窗口顶部添加一个锚点,一个固定的div来计算出没有运气的计算结果...
也尝试了这个
$(document).ready(function() {
// Cache the Window object
windowScroll = $(this).scrollTop();
$(window).scroll(function() {
$('.twit-bird').css({
'top' : -(windowScroll/3)+"px"
});
});
});
Run Code Online (Sandbox Code Playgroud) 在我的网站上,如果我的网址包含"测试"一词,我就会运行jQuery函数
我试图做的就是如果我的网址包含'rest'字符串,那么为页面上的元素添加边距?
我添加了一个jSfiddle试图展示到目前为止我做了什么.
$(document).ready(function(){
// How can I check to see if my url contains the word 'TEST' then run the below function?
$('.block-widget').css('margin-top, 252px')
});
Run Code Online (Sandbox Code Playgroud) 我有一个页面,当用户点击标题时,以下div切换显示.
我想以某种方式说出是否显示任何其他div:块然后将它们设置为先显示无.
我有以下......
$('.office-title').click(function(){
$(this).next('div').slideToggle();
return false;
});
Run Code Online (Sandbox Code Playgroud)
我的HTML标记就是这样......
<div class="office-row">
<h3 class="office-title">Title</h3>
<div class="office">sadasd</div>
</div>
<div class="office-row">
<h3 class="office-title">Title</h3>
<div class="office">sadasd</div>
</div>
<div class="office-row">
<h3 class="office-title">Title</h3>
<div class="office">sadasd</div>
</div>
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用javascript来检测访问者是否在触控设备上.
我有以下......
function is_touch_device() {
return 'ontouchstart' in window || 'onmsgesturechange' in window;
}
Run Code Online (Sandbox Code Playgroud)
上面的工作很好,除了ie11返回true,它是一个触摸设备,而实际上它不是.以前有人经历过这个吗?
我试图让我的头围绕Flexbox只是我无法弄清楚一些事情.
我已经构建了一个左侧列为290px且右侧为"内容区域"的布局.
我希望内容区域是流畅的,并且都是100%的高度.我有点实现了这一点,但如果我用宽度为100vw的东西填充内容区域,它会将左列向下推.
.right_col {
min-height: 792px;
height: 100%;
margin-left: 0px;
background: #F7F7F7;
display: flex;
padding: 0 !important;
width: 100%;
}
.callout-panel {
background: #fff;
width: 290px;
float: none;
clear: both;
padding: 0 20px;
}
.input-group {
position: relative;
display: table;
border-collapse: separate;
}
.input-group .form-control,
.input-group-addon,
.input-group-btn {
display: table-cell;
}
.input-group .form-control {
position: relative;
z-index: 2;
float: left;
width: 100vw;
margin-bottom: 0;
}Run Code Online (Sandbox Code Playgroud)
<div class="right_col">
<div class="callout-panel">Left column</div>
<section class="page-inner">
<div class="input-group">
<input type="text" class="form-control" placeholder="Search">
<span …Run Code Online (Sandbox Code Playgroud)我正在尝试为我网站的某些元素创建自定义光标,我遇到的唯一问题是虽然它工作正常,但我无法再单击元素。有谁知道这可能是什么原因造成的?
http://codepen.io/liamgallagher/pen/MmprwR
$('a').on('click',function(){
alert('sad');
});
(function() {
var follower, init, mouseX, mouseY, positionElement, printout, timer;
follower = document.getElementById('follower');
printout = document.getElementById('printout');
mouseX = (function(_this) {
return function(event) {
return event.clientX;
};
})(this);
mouseY = (function(_this) {
return function(event) {
return event.clientY;
};
})(this);
positionElement = (function(_this) {
return function(event) {
var mouse;
mouse = {
x: mouseX(event),
y: mouseY(event)
};
follower.style.top = mouse.y + 'px';
return follower.style.left = mouse.x + 'px';
};
})(this);
timer = false;
window.onmousemove = init = …Run Code Online (Sandbox Code Playgroud) 我正在研究一个使用Ajax的现有脚本,这是我以前从未使用过的.我的javascript文件中有一个变量集,它从我页面上的输入字段中获取其值.我需要使用Ajax将此发布到我的PHP页面我只是不知道从哪里开始,
我不确定你需要看什么代码,但我的javascript/AJAX代码是,我需要传递的变量是'var credoff'
$(".getPoint").click(function () {
var theid = $(this).attr("id");
var onlyID = theid.split("_");
var onlyID = onlyID[1];
var credoff = parseInt($(this).children('input.credoff:hidden').val());
$.ajax({
url: 'do.php',
type: 'POST',
data: "userID=" + onlyID,
success: function (data) {
if (data != "success1" && data != "success5") {
$("#" + theid).text(data);
} else {
$("#thediv_" + onlyID).fadeOut("slow");
$('#creditsBalance').fadeOut("slow");
newbalance = parseInt($('#creditsBalance').text());
Run Code Online (Sandbox Code Playgroud)
它必须采用这种格式吗?
data: "userID=" + onlyID,
"credoff=" + credoff
Run Code Online (Sandbox Code Playgroud) 我有一大堆所有名为.client-dark和.client-light的元素.
我想切换这些类,我正在尝试...
$('.clients-logo .container-fluid .row:nth-child(2)').find('.client-light').addClass('client-dark').removeClass('client-light');
$('.clients-logo .container-fluid .row:nth-child(2)').find('.client-dark').addClass('client-light').removeClass('client-dark');
Run Code Online (Sandbox Code Playgroud)
上面的第一行工作,但第二行覆盖它,是否有可能同时做这两个?