just wanna share

M 0

marckos

Learning
Member
Joined:Jun 25, 2014
Messages:195
Reaction score:3
Points:18
grants
₲8,750
<html>
<head>
<script type="text/javascript" src="http://localhost:8080/test/css-popup/css-pop.js"></script>
<link href="http://localhost:8080/test/css-popup/styles.css" rel="stylesheet" type="text/css" />
</head>
<body>


<div id="blanket" style="display:none;"></div>
<div id="popUpDiv" style="display:none;">
<a href="#" onclick="popup('popUpDiv')">
<img align="right" src="http://localhost:8080/test/css-popup/x.png">
</a>
<script type="text/javascript">
var popUpWindow;
function popup(n) {
popUpWindow = window.open(n);
}
function foo(obj){
test1 = "http://localhost:8080/test/document.html?"+obj.innerHTML;
popUpWindow.document.write('<iframe height="450" allowTransparency="true" frameborder="0" scrolling="yes" style="width:100%;" src="'+test1+'" type= "text/javascript"></iframe>');

}
</script>
</div>

<a href="#" onclick="popup('popUpDiv');foo(this);">OnSale</a>

</body>
</html>​
 
OP
M 0

marckos

Learning
Member
Joined:Jun 25, 2014
Messages:195
Reaction score:3
Points:18
grants
₲8,750
Your iframe is effectively a completely different page, so it's probably not working because your modal javascript doesn't exist in the iframe's page. That being said, even if you moved all your javascript inside the iframe, lauching the modal from in there would keep it trapped within the iframe.

Instead you want all your javascript and modal html/css stuff in the parent window and then from your iframe link call a popup launch function that exists in the parent window. So without knowing your exact code or what frameworks you're using, the basic idea in simple terms is to do the following (assuming jquery since you tagged the question as such)...

In your main window:

<script type="text/javascript" >
function showPopup() {
$("#newstyle").dialog();
}
</script>
...
<div id="newstyle" > xyax text ..my popup html </div>
In your modal:

<script type="text/javascript">
$(function() {
$("#modelboxnew").click(function() {
parent.showPopup();
});
});
</script>
...
<a href="#" id="modelboxnew" >open window</a>
Note that you need to be in control of both the main page & the iframe and they need to be hosted from the same domain for this to not be blocked by the browser's security.
 
OP
M 0

marckos

Learning
Member
Joined:Jun 25, 2014
Messages:195
Reaction score:3
Points:18
grants
₲8,750
$(this).qtip({
content: $('<iframe src="customTemplate.html" height="250" width="500" frameborder="0" style="border:0px solid red !important" noresize="noresize" />'),
button: 'Close',
show: {
prerender: false,
effect: {
type: sEffect,
length: effectLength
},
when: {
event: "click"
}
},
hide: {
effect: {
type: hEffect,
length: effectLength
},
when: {
event: "click"
}
},
position: {
corner: {
target: "bottomLeft",
tooltip: "topLeft"
}
},
style: {
width: 500,
padding: 0,
border: {
width: 0,
radius: 0,
color: "#A2D959"
},
classes: {
target: "accountNoPopup",
tooltip: "acInlineCtr",
tip: "",
title: "acInlineTitle",
content: "acInlineContent",
active: ""
}
},
api: {
onShow: function() {},
beforeHide: function() {
this.elements.target.removeClass("accountNoPopupActive")
},
beforeShow: function() {
var a = this;
this.elements.content.find("#closeIcon").click(function() {
a.hide()
});
this.elements.target.addClass("accountNoPopupActive")
}
}
})
});
 
jughead3716 10

jughead3716

Certified Lucidian
Contributor
Joined:Jun 28, 2014
Messages:4,809
Reaction score:4,654
Points:113
grants
₲60,990
sayang di ko magetz...haha...salamat na rin sa pag share mo dito sa forum na under sa akin... :D
 

Personalize

Top Bottom