我正在使用diapo滑块,除了Internet Explorer 8之外,它似乎适用于所有其他浏览器.
在调试模式下运行ie8后,我收到以下错误:
SCRIPT438:Object不支持属性或方法'getElementsByClassName'prototype.js,5988行5
return function(className, parentElement) {
return $(parentElement || document.body).getElementsByClassName(className);
};
Run Code Online (Sandbox Code Playgroud)
SCRIPT438:Object不支持属性或方法'fireEvent'prototype.js,第5736行第7行
if (document.createEvent)
element.dispatchEvent(event);
else
element.fireEvent(event.eventType, event);
return Event.extend(event);
Run Code Online (Sandbox Code Playgroud)
我在magento平台上运行这个滑块,看起来那个原型脚本有问题.它使用的原型版本是1.7,因此排除了脚本更新的可能修复.
注意:虽然,我在ie9中没有显示问题,但是我收到以下错误:
SCRIPT438:Object不支持属性或方法'dispatchEvent'prototype.js,第5734行character 7
if (document.createEvent)
element.dispatchEvent(event);
else
element.fireEvent(event.eventType, event);
return Event.extend(event);
Run Code Online (Sandbox Code Playgroud)
这些是diapo滑块工作所需的脚本,在头文件中加载了脚本标记.我不确定,但是这些脚本中的一些可能与现有脚本冲突:
<script type='text/javascript' src='http://www.pixedelic.com/plugins/diapo/scripts/jquery.min.js'></script>
<script type='text/javascript' src='http://www.pixedelic.com/plugins/diapo/jquery.mobile-1.0rc2.customized.min.js'></script>
<script type='text/javascript' src='http://www.pixedelic.com/plugins/diapo/jquery.easing.1.3.js'></script>
<script type='text/javascript' src='http://www.pixedelic.com/plugins/diapo/jquery.hoverIntent.minified.js'></script>
<script type='text/javascript' src='http://www.pixedelic.com/plugins/diapo/scripts/diapo.js'></script>
Run Code Online (Sandbox Code Playgroud) 如何使用下拉选择值创建新的usermeta字段?
我想为具有我想要的新自定义字段的特定值的所有用户创建条件语句.
例如,
新字段为:已批准下拉值为:是和否
条件语句将识别"已批准"字段值为"是"的所有用户.然后它会发布一个代码.
我正在使用wp_get_current_user函数(),它完全符合我的需要,但我只需要一个新的自定义usermeta字段.在示例中,新的usermeta字段将是"artwork_approved".
例:
wp_get_current_user();
if ($current_user->artwork_approved == 'Yes'){
echo 'Thank you for approving your artwork!';
}
Run Code Online (Sandbox Code Playgroud)
似乎没有插件,我真的需要这个功能.我真的很感激有关使用下拉选项创建新usermeta的一些建议.
*更新:
我使用Register Plus Redux创建了一个名为"Artwork Approved"的新usermeta字段.我做了一个下拉选项,选项"否"和"是"."否"选项设置为默认值.
这创建了"Artwork Approved"usermeta字段.我管理用户帐户并选择是或否现在使用这个新的usermeta字段,我使用的函数应该检查当前用户是否具有值为Yes的Artwork Approved.然后它应该显示一定的代码.
这是我使用新的usermeta字段的if语句:
<?php global $current_user; get_currentuserinfo(); if ($current_user->artwork_approved == 'Yes') { ?>
echo 'Your artwork is approved';
<?php } else { ?>
echo 'Your artwork is not approved';
<?php } ?>
Run Code Online (Sandbox Code Playgroud)
但正在发生的是它没有认识到if语句的第一部分.如果我使用已批准的图稿登录任何帐户,即使我对"已批准的图稿"选项"是",if语句也只显示"其他"部分.
我不知道为什么它没有在声明中承认是的选择.
谢谢
过去两周我一直在这个网站上工作,到目前为止一切顺利.我有冲突的javascripts,虽然我知道用什么方法来解决问题(jquery noconflict),我不知道如何使用它!
就我而言,我有:
这个案例很经典,它们可以单独工作但不能在一起工作.我读了一帮网站,大多数指向使用的解决方案:
<script>
jQuery.noConflict();
// Use jQuery via jQuery(...)
jQuery(document).ready(function(){
jQuery("div").hide();
});
// Use Prototype with $(...), etc.
$('someid').hide();
</script>
Run Code Online (Sandbox Code Playgroud)
我是javascript的新手,所以我不知道如何处理这个代码片段.
这是我的标题:
<script src="js/prototype.js"></script>
<script src="js/drop-o-matic.js"></script>
<script>
jQuery.noConflict();
// Use jQuery via jQuery(...)
jQuery(document).ready(function(){
jQuery("div").hide();
});
// Use Prototype with $(...), etc.
$('someid').hide();
</script>
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!-- <script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/jquery-ui.min.js"></script>
<script src="js/jquery.jigowatt.js"></script> -->
<script>
document.createElement("article");
document.createElement("footer");
document.createElement("header");
document.createElement("hgroup");
document.createElement("nav");
document.createElement("aside");
document.createElement("section");
document.createElement("menu");
document.createElement("hgroup");
</script>
Run Code Online (Sandbox Code Playgroud)
我只有原型&drop-o-matic js生效,表单的js文件被评论(就在IE评论之后).
原型和drop-o-matic用于html5导航(没有id,只是
<nav>
<ul>
<li><a …Run Code Online (Sandbox Code Playgroud) 我想知道如何根据一个表单的选择显示/隐藏不同的表单.
在下面的示例代码中,所有三个表单都自动设置为display:none.如果从"淋浴"形式中选择相应的值,我想只显示一个"隐藏"形式.因此,如果从"淋浴"表格中选择"表格1"选项,则显示下面的表格1; 如果从"淋浴"表格中选择"表格2"选项,则显示表格2; 等等.
优选地,具有淡入/淡出动画或其他光动画.
这是一个样本......
<form id="form-shower">
<select>
<option value="" selected="selected"></option>
<option value="form_name1">Form 1</option>
<option value="form_name2">Form 2</option>
<option value="form_name3">Form 3</option>
</select>
</form>
<form name="form_name1" id="form_1" style="display:none">
<!---- THIS IS FORM 1---->
</form>
<form name="form_name2" id="form_2" style="display:none">
<!---- THIS IS FORM 2---->
</form>
<form name="form_name3" id="form_3" style="display:none">
<!---- THIS IS FORM 3---->
</form>
Run Code Online (Sandbox Code Playgroud)
感谢您的帮助.
我已经配置了一个月的wordpress主题,但知道我想提高速度.我已经阅读了关于提高速度的不同提示,这些提示有很大帮助,但似乎我的域的初始负载花费的时间最长.使用firebug工具中的"net"选项卡,它向我显示正在运行的不同进程.我已经在页眉,页脚和我主题的其他部分更改了一些静态php请求.我删除了任何插件,我没有使用; 并优化了一些图像.我通过永久删除帖子/页面修订来优化我的数据库.我删除了垃圾数据库条目.
我应该提到我确实使用了W3 Total Cache,这确实提高了网站的速度,但是一些缓存选项令人困惑,因为最近对网站的一些更改没有被提取.我的网站基于我的会员创建/更新优惠券和提供企业,因此他们必须能够看到对网站及其个人列表所做的任何更改.所以暂时我将其停用.
为什么加载第一个请求需要这么长时间(平均8秒),这是我的域名?如何增加等待时间?
这是网站:savingsulove dot com
php ×2
prototypejs ×2
wordpress ×2
ajax ×1
forms ×1
html5 ×1
javascript ×1
jquery ×1
performance ×1
show-hide ×1
slider ×1