Skip to content Skip to sidebar Skip to footer

Website Should Have Same Background Color As Video

I have a website, with a HTML5-video. The website should have the same background color as the video, so I have set the website's background to the same HEX-Code as the video's. Th

Solution 1:

Could you please try the following:

function BrowserDetection() {
    if (navigator.userAgent.search("Safari") >= 0 && navigator.userAgent.search("Chrome") < 0) {
                     $(body).css("background-color":"grey");   
                    }
    }

You can probably find the right color HEX-Code, make sure this line is the last in line in your .js file and make your sure your .js file is loaded in after your .css file so that the cod overwrites your css if the browser is safari

source: http://forums.asp.net/t/1965754.aspx?Determine+the+browser+using+Javascript+JQuery

if the code above doesn't work the following may:

if ( $.browser.webkit ) {
    $(body).css("background-color":"grey"); 
  }

however the code above is deprecated in jquery 1.9 and above.


Post a Comment for "Website Should Have Same Background Color As Video"