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

  • Home
  • SEARCH
  • 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 4022052
In Process

The Archive Base Latest Questions

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

Hi everybody, I have some issue with one of my project. I’m currently developing

  • 0

Toolbar PrintScreen

Hi everybody,

I have some issue with one of my project. I’m currently developing a toolbar for Google Chrome. The concept is that my extension insert by using a content script an iframe in every page i visit. Materialized in Red on my Printscreen.

After that i’ve created another iframe who appear when i click on the “Menu” Button. This iframe appear like a dropMenu. Materialized in orange in the printscreen.

Well now let me explain my problem :

When i click on the “dropMenuButton” i execute this code :

$( "#dM1").click( function() {
    dropMenu('dropMenu1', $(this).position().left);
});

To be clear the function “dropMenu” will call my background page (by messaging exchange) to show or hide the dropMenu, in function if it’s allready activated or not.

Here is the executed code by the “dropMenu function”

if(document.getElementById("dropMenu"))
    {
        $("#dropMenu").slideUp(800, function() {
            $(this).remove();
        });
    }
    else
    {   
        var body = $('body'),
        MenuURL = chrome.extension.getURL(dropMenuPage + ".html"),
        iframe = $('<iframe id="dropMenu" scrolling="no" src="'+MenuURL+'">');

        body.append(iframe);    

        $("#dropMenu").hide().slideDown(800);

        // Shift the menu (Left)
        $("#dropMenu").css({left: marginLeft+'px'});
    }

So the event on dropMenuButton work perfectly but i want to provide some ameliorations like a .ClickOut event. What i want is that when somebody click outside the dropMenu (in orange) the menu will be hide.

I’ve tried a lot of things but nothing work…

Hope somebody will provide me some help !
Thanks in advance.

Edit (Injection) :

I’ve tried to inject the javascript like this :

var injectJs = $('<script type=text/javascript>' + 
            '$(document).click(function() {' +
                'dropMenu("dropMenu1", 0);' +
        '});');

body.append(injectJs);

injectJs = $('$("#dropMenu").click( function(e) {' + 
        'e.stopPropagation();' +
    '});' + 
    '</script>');
body.append(injectJs);

But it didn’t seems to inject on the page. It should have a problem somewhere…

  • 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:25:38+00:00Added an answer on May 20, 2026 at 10:25 am

    It works great but like this :

    $(document).click(function(){
        // hide drop down clicking anywhere on page:
        dropMenu('slideUp', 0);
    });
    
    $("#dM1").click( function(e) {
        e.stopPropagation(); // prevent click on drop menu from removing the drop down.
        dropMenu('dropMenu1', $(this).position().left);
    });
    

    Now i have to insert the similar code on the global page, someone have an idea how i can insert dynamically a js code ?

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

Sidebar

Related Questions

It seems that everybody knows you're supposed to have a clear distinction between the
Let's say I have a class that exposes one property. Is it considered to
everybody; I have this problem in asp.net, I have a page where I insert
Everybody knows that you should close a connection immediately after you finish using it.
So I purchased myself an iPhone ... everybody has one ... so I figured
I am considering implementing some sort of Software Update Notification for one of the
I have a program that uses System.DirectoryServices.AccountManagement.PrincipalContext to verify that the information a user
I have contemplating how to handle paper document input in Webapps for some time.
I have some trouble getting the VCS of teamcity work. I'm using perforce and
HI everybody, i have a question。 A sqlite have about 15 tables,and mysql same.i

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.