Changing CSS in Gmail's iframe content with jQuery
Trying to change the nav bar in Gmail to a different color. What I have below is not picking up the canvas_frame even though I can see it when I view the source?
What am I doing wrong?
$(document).ready(function() {
if ($("#ca开发者_C百科nvas_frame").length) {
$("#canvas_frame").load(function() {
$("#canvas_frame").contents().find(".qp").css("background-color","#FF0000");
});
}
});
How are you running your Javascript code? I can change the colour by following these steps -
- Open Firefox (with Firebug installed)
- Install jquerify bookmarklet (http://www.learningjquery.com/2009/04/better-stronger-safer-jquerify-bookmarklet)
- Go to GMail and run the bookmarklet
If I then run the following code in the Firebug console window the colour changes -
jQuery("#canvas_frame").contents().find(".qp").css("background-color","#00ff00");
精彩评论