如您所见,文本区域的高度完美地返回.但这是因为文本区域不是字体 - 面部模式.
在我的网站上,文本是font-face生成的,但它在font-face加载之前得到了高度,因为一旦你将div悬停一次并且第二次迭代运行,它就会返回正确的高度.
所以jQuery的高度是有效的,但只有在网站完全加载了font-face之后.
有没有解决这个问题?
谢谢你的任何指示.
简单的标记
<div class="home-mod">
<div class="mod-center"><img ... /></div>
<div class="mod-info"> <!-- this is the slider, slides up when .mod-info is hovered -->
<a class="mod-link" href="..." title="test">DYNAMIC FONT-FACE TEXT HERE</a>
<div class="mod-excerpt">
DYNAMIC NORMAL TEXT HERE
</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
当前的脚本 - 完整的工作完美,当文本不是前面的时候
$(function() {
// positioning the current div.mod-info inside current div.home-mod
$(".home-mod").each(function() {
// this finds the div.mod-link height, and assigns var to div.mod-info top position
var moduleLink = $(this).find(".mod-link").height(),
modulePlus = moduleLink+20; …Run Code Online (Sandbox Code Playgroud) 这个问题我相信将来会帮助数百人.但是脚本有点超出我的jQuery能力.我有jQuery基本技能,但无法解决这个问题.
基本上我需要一个iFrame(托管在一个单独的域上)来坐在我的主网站上.我不想使用iFrame,但在我的情况下我别无选择!我需要iFrame调整到iframe内部主体的高度.
目前使用Ben Alman jQuery postMessage插件,看起来它可以做到这一点.但是当前的例子里面有不必要的代码,它允许切换调整iFrame的大小......
我不需要这个切换,我需要的是让iFrame调整到正确的iframe内容体高度.我需要iframe高度来调整iframe内的身高变化.
这是我到目前为止发现的......
我把它放在iframe内容文件上
这是在服务器上:http://myiframecontent.com/
<script src="js/jquery.ba-postmessage.js" type="text/javascript"></script>
<script type="text/javascript">
$(function(){
// Get the parent page URL as it was passed in, for browsers that don't support
// window.postMessage (this URL could be hard-coded).
var parent_url = decodeURIComponent( document.location.hash.replace( /^#/, '' ) ),
link;
// The first param is serialized using $.param (if not a string) and passed to the
// parent window. If window.postMessage exists, the param is passed …Run Code Online (Sandbox Code Playgroud) 我已经创建了一个jsFiddle来演示我的问题.http://jsfiddle.net/motocomdigital/NXzcx/3/
概述
我刚刚开始开发一个网站,我想使用一个多功能的jQuery插件来用于网站上的所有滑块和代码,而不是多个jQuery插件.
我做了一些搜索并偶然发现了jQuery bxslider - 文档看起来不错,所以我决定先放弃它.
我正在尝试创建一个与谷歌购物页面上的功能相似的滑块.我可以理解这个jQuery bxslider插件可能无法实现寻呼机之间的精确转换.
问题
请参阅我的http://jsfiddle.net/motocomdigital/NXzcx/3/以供参考.
根据谷歌购物页面的例子,我设法让幻灯片显示自动播放,但它似乎没有将该.page-active类添加到当前的寻呼机?...当您选择寻呼机时,它不会继续自动播放?文档似乎没有解释这一点.
我有什么想法可以达到这个目的吗?
我在这里看了这个演示... http://bxslider.com/examples/thumbnails-pager-method-1
代码
$(function() {
// assign the slider to a variable
var slider = $('#banner-slider').bxSlider({
controls: false,
mode: 'vertical',
auto: true
});
// assign a click event to the external thumbnails
$('.banner-pager a').click(function() {
var thumbIndex = $('..banner-pager a').index(this);
// call the "goToSlide" public function
slider.goToSlide(thumbIndex);
// remove all active classes
$('.banner-pager …Run Code Online (Sandbox Code Playgroud) 我真的很感谢任何jquery专家帮助作为我以前使用过的方法,并不适合这个新的应用程序.
我正在努力实现的目标
我的网站包装器的右侧和左侧有两个选项卡,只有在您向下滚动页面时才会显示.当标签到达屏幕中心时,它们将变为固定位置,然后出现锁定位置.看下面的一般效果/想法......
http://jsfiddle.net/motocomdigital/SGCHt/2/
问题
您可能想知道为什么我问这个小提琴是否已经起作用的问题.
上面的小提琴是有效的,因为它适用于从窗口顶部滚动到位置.
但是在我的网站上,这些标签只存在于内容区域,并且无法在我的标题,横幅,幻灯片区域上方运行.
在上面的jsFiddle示例中,您会注意到没有标题,横幅或幻灯片.因此,这对我当前的脚本来说不是问题,因为选项卡容器列一直运行到顶部.
请看下面的小提琴有不同的布局组合,然后你会看到我的问题.
请注意我删除了选项卡容器列上的橙色背景,以便您可以看到设计的观点.
现在看下面的小提琴,它在标签容器列上有橙色背景,这样你就可以看到标签如何只出现在内容区div旁边的结构.
http://jsfiddle.net/motocomdigital/SGCHt/6/
解
该脚本有些如何在屏幕顶部达到50%时将固定位置添加到选项卡.但我不知道如何计算这个,因为标签容器不会一直运行到窗口顶部.是否有另一种实现此目的的脚本方法?
任何帮助都会非常感激.谢谢!
我创造了一个小提琴来演示我的问题:http://jsfiddle.net/motocomdigital/QyhpX/5/
概述
我正在使用jQuery .animate功能创建一个标签式网站.在我的直播网站上哪一个在第一次轮换时看起来很奇怪,但我似乎无法在小提琴中复制它.
左侧选项卡将div#wrapper右侧定位设置为-170px并返回0 - 然后我添加了.removeAttr('style');删除样式属性,因此它不会干扰右侧选项卡.
右侧选项卡将div#wrapper左侧定位设置为-170px并返回0 - 然后我添加了.removeAttr('style');删除样式属性,因此它不会干扰左侧选项卡.
问题
在.removeAttr('style');不去除后的内嵌样式属性.animate完成,这将导致如果有合适的标签已经打开了我的左选项卡是失去作用.
请参阅jsfiddle http://jsfiddle.net/motocomdigital/QyhpX/5/
还有人注意到第一个选项卡上的任何故障都打开了交替吗?左还是右?它似乎挂在第一次打开,然后突然它打开,但顺利关闭,然后顺利重新打开.它只是第一次点击开放.
TAB CODE SCRIPT
var $tabLeft = $(".tab-left-button span"),
$tabRight = $(".tab-right-button span"),
$siteSlide = $("#wrapper");
$tabLeft.on('click', function () {
if ($tabLeft.html() == 'X' ) {
$siteSlide.stop().animate({ right: "0" }, 300);
$tabLeft.html('Tab Left');
return false;
$siteSlide.removeAttr('style');
} else {
$siteSlide.stop().animate({ right: "-170px" }, 300);
$tabLeft.html('X');
$('body,html').animate({
scrollTop: 0
}, …Run Code Online (Sandbox Code Playgroud) 这很简单,但我无法解决.
我正在构建一个wordpress网站,我希望使用PHP而不是javascript在我的404页面上进行重定向.
<?php header("Location: www.myblogurl.com"); ?>
Run Code Online (Sandbox Code Playgroud)
我在wordrpess网站上使用它来获取我的博客的URL ...
<?php bloginfo('url'); ?>
Run Code Online (Sandbox Code Playgroud)
但我似乎无法将两个PHP脚本合并在一起,请看下面我的不良尝试.
<?php
$location = bloginfo('url');
header( 'Location:' + $location ) ;
?>
Run Code Online (Sandbox Code Playgroud)
这似乎是回应我的网站URL而不是重定向.
请帮助我,谢谢.
我正在寻找一个适用于所有浏览器的简单解决方案.
对于特定的文件类型,或通过类的目标链接:如何让它们在所有主流浏览器中强制下载.
我以为我找到了apachce服务器的完美解决方案 - 将其添加到.htaccess中.
http://css-tricks.com/snippets/htaccess/force-files-to-download-not-open-in-browser/
AddType application/octet-stream .csv
AddType application/octet-stream .xls
AddType application/octet-stream .doc
AddType application/octet-stream .avi
AddType application/octet-stream .mpg
AddType application/octet-stream .mov
AddType application/octet-stream .pdf
Run Code Online (Sandbox Code Playgroud)
似乎在Firefox和Safari中工作,但不是chrome或IE(尚未测试任何其他内容)
任何人都可以帮我解决如何建立链接强制下载文件,而不是在浏览器中打开所有浏览器.
我似乎找不到完整的浏览器校对解决方案.这不可能吗?
教程或片段的任何链接都很棒.
我的网站,如果基于PHP,可以使它与PHP一起使用,如果可行的话.
谢谢
是否有可能执行相反的操作$(this)?
因此,不是gettin this元素,它得到一切匹配.sb-popular-thumb a但排除$(this)?
请参阅下面的示例代码.我已标记$(this),$(reverse)所以你可以看到我想要实现的目标.
$('.sb-popular-thumb a').hover(
function () {
$('.sb-popular').stop().animate({
height : '168px'
}, 200);
$(this).siblings('.sb-popular-thumb-title').show();
$(reverse).siblings('.sb-popular-thumb-overlay').stop().fadeIn(200);
},
function () {
$('.sb-popular').stop().animate({
height : '140px'
}, 200);
$(this).siblings('.sb-popular-thumb-title').hide();
$(reverse).siblings('.sb-popular-thumb-overlay').stop().fadeOut(200);
});
Run Code Online (Sandbox Code Playgroud) 我正在努力获得一个简单的字符串替换工作在wordpress the_content函数.
<?php
$phrase = the_content();
$find = '<p>';
$replace = '<p style="text-align: left; font-family: Georgia, Times, serif; font-size: 14px; line-height: 22px; color: #1b3d52; font-weight: normal; margin: 15px 0px; font-style: italic;">';
$newphrase = str_replace($find, $replace, $phrase);
echo $newphrase;
?>
Run Code Online (Sandbox Code Playgroud)
它似乎<p>还在呼应.
代替 <p style="text-align: left; font-family: Georgia, Times, serif; font-size: 14px; line-height: 22px; color: #1b3d52; font-weight: normal; margin: 15px 0px; font-style: italic;">
我正在尝试ORDER BY自定义选择查询的结果.
但我试图通过元键的值来排序.
请在下面查看我的查询...
$get_atts = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE $wpdb->posts.post_type IN ('individual') ORDER BY $wpdb->posts.meta_key = 'surname' ASC");
Run Code Online (Sandbox Code Playgroud)
正如你所看到的,这ORDER BY打破了......
ORDER BY $wpdb->posts.meta_key = 'surname' ASC"
Run Code Online (Sandbox Code Playgroud)
所以我试图按价值排序 surname
但我似乎没有工作.可以解释为什么或帮助?