I'm trying to retrieve the current font from an element that is within an
iframe... unsuccessfully.


>From within the document itself I can retrieve the font just fine using the
following:

$(document).ready(function(){
        var getFontFamily = $("#get_font_of_this").css("font-family");
        alert(getFontFamily);
});

-- returns (Comic Sans MS, cursive)


But once I try retrieving the same element's font from a parent document as
shown below, I do not get the expected response:

$(document).ready(function(){
        $("#iframe").load(function(){
                var getFontFamily =
$("#iframe").contents().find("#get_font_of_this").css("font-family");
                alert(getFontFamily);
    });
});

-- returns (serif)


I can seemingly retrieve any other css property through this method, but for
some reason the font returns as a default (serif), or sometimes (Arial, ...,
serif)


If anyone can shed some light on this issue, I will be indebted to you. 

Thanks in advance!

Example page can be found at  http://www.arcadiasitedesign.com/page1.php
http://www.arcadiasitedesign.com/page1.php 

-- 
View this message in context: 
http://old.nabble.com/Get-%22font-family%22-from-iframe-tp27632699s27240p27632699.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.

Reply via email to