我有这个代码。在“content”部分,我想要显示一个变量-- currentCard。
下面是代码。任何帮助都是非常感谢的!
$("#middle").flip({
direction:'rl',
content:'currentCard',
color:'#fff'
})发布于 2013-02-17 23:02:42
奇怪的是,没有引号对你不起作用,试试这段代码:
var currentCard = "card123";
console.log(currentCard);
$("#middle").flip({
direction:'rl',
content:currentCard,
color:'#fff'
})要查看控制台输出,请使用浏览器或Firebug的开发人员工具。
如果此代码与"cart123“一起使用,请删除定义currentCard的行,并保留控制台打印,以确保此变量的值是您认为的值。
发布于 2013-02-17 23:02:52
你的代码不应该写成:
$("#content").flip({ //changed to 'content' from 'middle'
direction:'rl',
content:currentCard, //remove the quotes, because with the quotes, it'll anyway never get the value of the variable.
color:'#fff'
});https://stackoverflow.com/questions/14922359
复制相似问题