Reputation: 33
I have written a code to show popover iframe on hover a link. Now I want to pass the link value to that iframe window on popover. How can I do that? Here is my code
<a href="#" class="show-pop-iframe btn btn-default " data-placement="vertical" id="sample" value="[email protected]">[email protected] </a>
<a href="#" class="show-pop-iframe btn btn-default " data-placement="vertical" id="sample1" value="[email protected]">[email protected] </a>
<div id="auto"></div>
(function(){
var settings = {
trigger:'hover',
title:'Send Mail To User',
content:'<p>This is webui popover demo.</p><p>just enjoy it and have fun !</p>',
width:auto,
multi:true,
closeable:false,
style:'',
delay:300,
padding:true,
backdrop:false
};
function initPopover(){
var iframeSettings = {
width:500,
height:350,
closeable:true,
padding:false,
type:'iframe',
url:'http://localhost/live/liveuser.php'
};
$('a.show-pop-iframe').webuiPopover('destroy').webuiPopover(
$.extend({},settings,iframeSettings)
);
}
initPopover();
})();
Upvotes: 2
Views: 226
Reputation: 3330
function initPopover(){
var iframeSettings = {
width:500,
height:350,
closeable:true,
padding:false,
type:'iframe'
};
$('a.show-pop-iframe').webuiPopover('destroy');
$.each($('a.show-pop-iframe'), function (key, element) {
var url = 'http://localhost/live/liveuser.php';
url += '?' + encodeURI($(element).attr("value")); // You will get link value in url
webuiPopover($.extend({url: url},settings,iframeSettings));
}
}
Upvotes: 1