Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Trouble targeting <object> element in jQuery
Old 07-14-2010, 06:08 AM Trouble targeting <object> element in jQuery
pealo86's Avatar
Super Spam Talker

Posts: 876
Name: Matt Pealing
Location: England, north west
Trades: 0
I have an <object> element on a website like so:
Code:
<div id="wrapper-splash">
        <object id="splash" type="application/x-shockwave-flash" data="swf/splash.swf" width="750" height="575">
            <param name="movie" value="swf/splash.swf" />
            <param name="wmode" value="transparent" />
        </object>
    </div>
I've tried targeting it with this script:
Code:
<script type="text/javascript">
$(document).ready(function() {
    $('#splash').click(function() {
        $(this).delay(800).remove();
    });
});
</script>
But it doesn't work in either FF or Safari (I assume in doesn't work in any browsers).

The script simply doesn't do anything when the element is clicked.

Does anybody know why this might be?

Thanks
__________________

Please login or register to view this content. Registration is FREE
pealo86 is offline
Reply With Quote
View Public Profile Visit pealo86's homepage!
 
 
Register now for full access!
Old 07-14-2010, 07:27 AM Re: Trouble targeting <object> element in jQuery
Extreme Talker

Posts: 246
Trades: 0
Have you thought about doing this on the div tag instead to see if that works instead?
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
stbuchok is offline
Reply With Quote
View Public Profile
 
Old 07-14-2010, 07:31 AM Re: Trouble targeting <object> element in jQuery
pealo86's Avatar
Super Spam Talker

Posts: 876
Name: Matt Pealing
Location: England, north west
Trades: 0
I tried that yes, but it didn't work in FF
__________________

Please login or register to view this content. Registration is FREE
pealo86 is offline
Reply With Quote
View Public Profile Visit pealo86's homepage!
 
Old 07-14-2010, 07:54 AM Re: Trouble targeting <object> element in jQuery
Extreme Talker

Posts: 246
Trades: 0
This is kinda quick and dirty but the only way I could figure out how to do it in the last 10 minutes was to have an overlaying div on top of the object:

HTML Code:
<html>
<head>

<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>

<script type="text/javascript">
$(document).ready(function() {
    $('#overlay').click(function() {
        $('#divsplash').delay(800).remove();
        $('#absOverlay').delay(800).remove();
    });
});
</script>

</head>
<body>

<div id="absOverlay" style="position: absolute;">
<div id="overlay" style="position: relative; width: 480; height: 385; border: solid 1px #000000; background-color: #ffffff;"></div>
</div>

<div id="divsplash">
        <object ID="SPLASH" width="480" height="385" style="background-color: #ff0000;">

		</object>
</div>

</body>
</html>
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
stbuchok is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Trouble targeting <object> element in jQuery
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.13378 seconds with 12 queries