SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Addict ketting00's Avatar
    Join Date
    Jul 2011
    Posts
    309
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    How to make background transparent with javascript

    Hello all,

    I've used the bellow snippet to create the dummy iframe, but it look ugly, and I want to make it transparent, I can't find solution through Google

    shimmer.style.background='#000000';

    BWT. without a background color, the dummy iframe will not appear

    Thanks in advance

  2. #2
    SitePoint Guru
    Join Date
    Sep 2006
    Posts
    731
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try:
    Code:
    shimmer.style.backgroundColor = 'transparent';
    That assumes that shimmer is a valid reference to the body element of a document.
    Tab-indentation is a crime against humanity.

  3. #3
    SitePoint Addict ketting00's Avatar
    Join Date
    Jul 2011
    Posts
    309
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Thank you so much for fast response, I'll try this

  4. #4
    SitePoint Addict ketting00's Avatar
    Join Date
    Jul 2011
    Posts
    309
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Question

    Quote Originally Posted by Logic Ali View Post
    Code:
    shimmer.style.backgroundColor = 'transparent';
    This works on all browsers but Firefox. Why

  5. #5
    SitePoint Guru
    Join Date
    Sep 2006
    Posts
    731
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ketting00 View Post
    This works on all browsers but Firefox. Why
    Remember Firefox has a default white background, but if that's not it, how do you get the shimmer reference?
    Tab-indentation is a crime against humanity.

  6. #6
    SitePoint Addict ketting00's Avatar
    Join Date
    Jul 2011
    Posts
    309
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    I get it from here:

    OraTransplant Using IFrame Shim to (partly) cover a Java applet

    I try to overlay a java applet with a dummy iframe to display a dropdown javascript menu.

  7. #7
    SitePoint Addict ketting00's Avatar
    Join Date
    Jul 2011
    Posts
    309
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    OK, I found it.
    Here's the solution:

    shimmer.style.backgroundColor = 'rgba(255, 255, 255, 0.5)';

    Thanks for your help


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •