1

Здравствуйте,

На родительскую страницу через iframe вставляю html. При этом во вставляемом html содержится несколько ссылок. Необходимо, чтобы эти ссылки открывались не в окне iframe, а вместо всей родительской страницы.

Код родительской страницы

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<link href="styles.css" rel="stylesheet" type="text/css">
<style type="text/css">
</style>
<title>tindirindis</title>
</head>

<body>
  <nav>
  <iframe src="EdgeAnimate/nav_programs.html" width="555" height="36">Ваш браузер не поддерживает встроенные фреймы!</iframe>
  </nav>
</body>
</html>

Код вставляемого html, что создан в EdgeAnimate, и его файл JavaScript

/**
 * Adobe Edge: symbol definitions
 */
(function($, Edge, compId){
//images folder
var im='images/';

var fonts = {};
var opts = {
    'gAudioPreloadPreference': 'auto',

    'gVideoPreloadPreference': 'auto'
};
var resources = [
];
var symbols = {
"stage": {
    version: "4.0.0",
    minimumCompatibleVersion: "4.0.0",
    build: "4.0.0.359",
    baseState: "Base State",
    scaleToFit: "none",
    centerStage: "both",
    initialState: "Base State",
    gpuAccelerate: false,
    resizeInstances: false,
    content: {
            dom: [
            {
                id: 'button_5',
                type: 'rect',
                rect: ['0', '0','auto','auto','auto', 'auto']
            }],
            symbolInstances: [
            {
                id: 'button_5',
                symbolName: 'button_5',
                autoPlay: {

                }
            }
            ]
        },
    states: {
        "Base State": {
            "${_Stage}": [
                ["color", "background-color", 'rgba(39,0,255,0.00)'],
                ["style", "width", '555px'],
                ["style", "height", '36px'],
                ["style", "overflow", 'hidden']
            ]
        }
    },
    timelines: {
        "Default Timeline": {
            fromState: "Base State",
            toState: "",
            duration: 0,
            autoPlay: true,
            timeline: [
            ]
        }
    }
},
"button_5": {
    version: "4.0.0",
    minimumCompatibleVersion: "4.0.0",
    build: "4.0.0.359",
    baseState: "Base State",
    scaleToFit: "none",
    centerStage: "none",
    initialState: "Base State",
    gpuAccelerate: false,
    resizeInstances: false,
    content: {
            dom: [
                {
                    id: '_02_2',
                    type: 'image',
                    rect: ['0px', '0', '555px', '36px', 'auto', 'auto'],
                    fill: ['rgba(0,0,0,0)', 'images/02_2.png', '0px', '0px']
                },
                {
                    rect: ['126px', '5px', '133px', '26px', 'auto', 'auto'],
                    id: 'Rectangle1Copy4',
                    stroke: [0, 'rgba(0,0,0,1)', 'none'],
                    type: 'rect',
                    fill: ['rgba(192,192,192,0.00)']
                }
            ],
            symbolInstances: [
            ]
        },
    states: {
        "Base State": {
            "${__02_2}": [
                ["style", "left", '0px'],
                ["style", "overflow", 'visible']
            ],
            "${symbolSelector}": [
                ["style", "height", '36px'],
                ["style", "width", '555px']
            ],
            "${_Rectangle1Copy4}": [
                ["color", "background-color", 'rgba(192,192,192,0.00)'],
                ["style", "top", '5px'],
                ["style", "height", '26px'],
                ["style", "width", '133px']
            ]
        }
    },
    timelines: {
        "Default Timeline": {
            fromState: "Base State",
            toState: "",
            duration: 0,
            autoPlay: true,
            timeline: [
            ]
        }
    }
}
};


Edge.registerCompositionDefn(compId, symbols, fonts, resources, opts);

/**
 * Adobe Edge DOM Ready Event Handler
 */
$(window).ready(function() {
     Edge.launchComposition(compId);
});
})(jQuery, AdobeEdge, "EDGE-1603117873");
<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
	<title>Untitled</title>
<!--Adobe Edge Runtime-->
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <script type="text/javascript" charset="utf-8" src="nav_programs_edgePreload.js"></script>
    <style>
        .edgeLoad-EDGE-1603117873 { visibility:hidden; }
    </style>
<!--Adobe Edge Runtime End-->

</head>
<body style="margin:0;padding:0;">
	<div id="Stage" class="EDGE-1603117873">
	</div>
</body>
</html>

Заранее благодарю за помощь.

1 ответ 1

2

Если не ошибаюсь, атрибут target HTML-элемента <a> это то, что вам нужно. В частности, ссылкам, которые должны открываться в родительском окне, нужно добавить

target="_top"

Подробнее про target: http://www.w3schools.com/tags/att_a_target.asp

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.