Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4022616
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:29:51+00:00 2026-05-20T10:29:51+00:00

How can I enable dragging of an <embed> object on a webpage (with javascript)?

  • 0

How can I enable dragging of an <embed> object on a webpage (with javascript)? Normally, when I select some text or an image on a webpage, I am able to drag it around, and I want to do the same for the object.

Specifically, I want to be able to drag a YouTube video. I’m not concerned about dropping for now, and also I don’t want to use jQuery UI if at all possible. The YouTube embed looks like this

<embed id="movie_player" ... type="application/x-shockwave-flash" />

I’m writing a browser extension (for Chrome), so I have full access to the DOM and the browser.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T10:29:52+00:00Added an answer on May 20, 2026 at 10:29 am

    I think jQuery is the best here, it is also javascript and all you do is embed it to your website. And if you want a semi-transparent effect to view that you are dragging, I think you can add an event for a dragging handle. Use onMouseDown and onMouseUp. For example, this div is handle your youtube:
    The CSS for transparent is:

    opacity: .7; filter:Alpha(Opacity=70); whereby 0.7 and 70 is the opacity percent of element!

    [Example]:

    <div onMouseDown="this.style.opacity='0.7'; this.style.filter='Alpha(Opacity=70)';" onMouseUp="this.style.opacity='1.0'; this.style.filter='Alpha(Opacity=100)';"><br><embed something here></embed></div>.

    Ok, If you change your mind somehow and you want to use jQuery, give it a try, I promise it is extremely easy!

    First of all, embed this into your website:

    <script src="http://code.jquery.com/jquery-1.5.1.min.js"></script><script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.10/jquery-ui.min.js"></script>

    <script language="javascript" type="text/javascript">$(document).ready(function(){$(".drag").draggable();});</script>

    Secondly, give anything you want to drag a class “drag”, in this case:

    <div class="drag">YOUR YOUTUBE VIDEO EMBED HERE</div>

    Use it together with the semi-transparent effect, I think that all you need, and I hope this help.

    xx3004,

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I enable users to resize a panel at runtime by dragging a
How I can enable the drag and drop event on jlabel ? I have
Does anyone know how I can enable text alignment of header tags through the
I'm looking for an add-in to VS2008 that can enable structural highlighting ( vertical
I can't get my GridView to enable a user to sort a column of
Is there a framework that can be used to enable a C# Windows Service
How can I programmatically lock/unlock, or otherwise prevent/enable editing, a source file on Linux
How do I enable external access to MySQL Server? I can connect locally but
I need to programmatically enable READ COMMITTED SNAPSHOT in SQL Server. How can I
I have to enable all the text in a winforms application to be replaced;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.