How to alter css style from parent page inside an iframe using jquery


Tags: jquery,html,css,iframe

Problem :

i have a site that consist of a Page and an iFrame, i want to change the style of the Parent page from the iframe and vise versa



Solution :

You could try this:

parent.$("#ID").css("border","1px solid red"); or window.parent.$('#ID').css("border","1px solid red");

Note: would only work if they are on the same domain.


    CSS Howto..

    In CSS/JS, how to word-wrap at every nth word?

    How do I avoid using !important?

    How can I prevent the Featherlight lightbox from creating recursive dialogs?

    HTML/CSS slideshow without javascript

    How do you target div last-child within another div?

    How to add event handlers to DIVS with CSS classes containing a particular string?

    Issue with changing how containers look based on values in an MD array

    How to set dynamic responsive divs with only CSS (no javascript)?

    How to zoom in / out depending on browser height, using CSS zoom property? [closed]

    How do I update an div css to display an complete image when section is complete?

    Using CSS or Java to Show or Hide Empty Content Area

    How to do automatic reload of page when viewed in iPad Portrait mode?

    How to remove rounded from to select query in jquery?

    How to use CSS to position div popup when using :hover…?

    How to search a particular text within an HTML Text and highlight the search string with a color

    How to create a smooth zoom and display an overlay when another HTML element gets hovered?

    How to make CSS button appear transparent

    How an mobile compatible website handles the performance?

    How to align my dropdown menu to center of the page?

    How to center element in css?

    How manage Divisions in browser resizing

    How to expand textarea to fit text vertically and horizontally?

    How to put a div at left or right in pure CSS?

    how to apply css class condtionally in angularjs

    How to implement this logic in CSS?

    How to display a css animation in the center of the screen

    How to make a generic struct to contain any CSS properties' values

    How Polymer Hero Transition works

    How to use body_class to change css according to page hierarchy

    How to display a div on hover of button using css