【问题标题】:pass value to iframe on popover using jquery使用jquery在popover上将值传递给iframe
【发布时间】:2016-10-12 04:22:20
【问题描述】:

我编写了一个代码来在悬停链接时显示弹出 iframe。现在我想将链接值传递给弹出框上的那个 iframe 窗口。我怎样才能做到这一点? 这是我的代码

<a href="#" class="show-pop-iframe btn btn-default " data-placement="vertical" id="sample" value="email@domain.com">email@domain.com </a>
<a href="#" class="show-pop-iframe btn btn-default " data-placement="vertical" id="sample1" value="email1@domain1.com">email1@domain1.com </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();
})();

【问题讨论】:

  • 这个问题解决了吗?
  • 没有。 @Parag Bhayani
  • 好的,明天试试...如果我忘记了提醒我... ????

标签: javascript jquery html twitter-bootstrap iframe


【解决方案1】:
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));
    }
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-12-12
    • 2010-10-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多