php、jquery、flash 和Firefox 3 中的 .click 函数 - Stumper
我有一个页面,它使用 PHP 来构建自身,然后使用 Jquery 将一些 SWF 嵌入到具有基于 PHP 代码部分中的数据库连接的不同 Flashvar 的页面中。然后,我有一个 jQuery .click(function(){ ,它会立即触发一个简单的警报来测试功能 - 这在 Safari 中按预期工作,但由于某些奇怪的原因,.click 在 Firefox 下不会触发?代码如下,有人可以解释一下 Firefox 问题吗:
$(document).ready(function() {
$('#gallery<? echo $count; ?>').flash({
// test_flashvars.swf is the flash document
swf: 'button.swf',
width: 570,
height: 80,
// these arguments will be passed into the flash document
params: {
wmode: 'transparent',
},
flashvars: {
myText: "<?php echo urlencode($row['gal_Title']); ?>"
}
});
$('#gallery<? echo $count; ?>').click(function(){
alert('Alert <?php echo $count; ?>');
});
<?
$count = $count+1;
} else {
}
}
mysql_free_result($GalleryItems);
?>
该页面表面上可以工作,我想我可以将 .click 函数作为 clickVar 移动到 swf,但我希望单击启动 AJAX 调用来更新页面的一部分,这将然后导致我从 flash 中获取调用回到 jQuery 元素时出现问题 - 不,
非常感谢您的帮助,
MM
I have a page that is using PHP to build itself and then uses Jquery to embed some SWF's into the page with different Flashvars based off the DB connection in the PHP section of code. I then have a jQuery .click(function(){ that fires a simple alert at the moment to test for functionality - this works as expected in Safari, but for some strange reason the .click will not fire under Firefox ? Code is below, can someone shed some light on the Firefox issue:
$(document).ready(function() {
$('#gallery<? echo $count; ?>').flash({
// test_flashvars.swf is the flash document
swf: 'button.swf',
width: 570,
height: 80,
// these arguments will be passed into the flash document
params: {
wmode: 'transparent',
},
flashvars: {
myText: "<?php echo urlencode($row['gal_Title']); ?>"
}
});
$('#gallery<? echo $count; ?>').click(function(){
alert('Alert <?php echo $count; ?>');
});
<?
$count = $count+1;
} else {
}
}
mysql_free_result($GalleryItems);
?>
The page ostensibly works and I suppose I could move the .click function through to the swf as a clickVar but I wanted the click to initiate an AJAX call to update a section of the page which would then cause me issues with grabbing the call from flash back into the jQuery elements - no ?
Many thanks for any help,
MM
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我相信 Flash 在某些浏览器中会吃掉 onclick - 我自己从来没有这样做过,我不确定。您是否可以捕获 Flash 中的点击并使用 ExternalInterface 调用回 JavaScript?
I believe Flash eats the onclick in some browsers - having never had to do this myself, I'm not certain. Is it possible for you to capture the click within Flash and make a call with ExternalInterface back out to JavaScript?