小编use*_*794的帖子

在屏幕中心启动Facebook共享弹出窗口

以下代码运行良好,并在屏幕上启动Facebook弹出窗口,但此弹出窗口不居中.

<script type="text/javascript">
function fbs_click() {u=location.href;t=document.title;window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');return false;}
Run Code Online (Sandbox Code Playgroud)

<a href="http://www.facebook.com/share.php?u=<full page url to share" onClick="return fbs_click()" target="_blank" title="Share This on Facebook"><img src="images/facebookimage.jpg" alt="facebook share"></a>
Run Code Online (Sandbox Code Playgroud)

以下是以弹出窗口为中心的脚本:

    <script type="text/javascript">
 function MyPopUpWin(url, width, height) {
    var leftPosition, topPosition;
    //Allow for borders.
    leftPosition = (window.screen.width / 2) - ((width / 2) + 10);
    //Allow for title and status bars.
    topPosition = (window.screen.height / 2) - ((height / 2) + 50);
    //Open the window.
    window.open(url, "Window2",
    "status=no,height=" + height + ",width=" + width + ",resizable=yes,left="
    + …
Run Code Online (Sandbox Code Playgroud)

javascript social xhtml facebook popup

12
推荐指数
1
解决办法
4万
查看次数

用这个javascript打开屏幕中心的新窗口?

我对javascript的体验非常有限.我想在屏幕中央打开新窗口.

<script type="text/javascript">
function fbs_click() {
var twtTitle = document.title;
var twtUrl = location.href;
var maxLength = 140 - (twtUrl.length + 1);
if (twtTitle.length > maxLength) {
    twtTitle = twtTitle.substr(0, (maxLength - 3)) + '...';
}
var twtLink = 'http://twitter.com/home?status=' + encodeURIComponent(twtTitle + ' ' + twtUrl);
window.open(twtLink,'','width=300,height=300'); } </script>
Run Code Online (Sandbox Code Playgroud)

如果有人可以请更新我的代码来完成一个中心的弹出窗口,这将是惊人的!

html javascript popup popupwindow

2
推荐指数
1
解决办法
3万
查看次数

jquery show hide使用href标签

我有一些jquery根据按下哪个按钮显示和隐藏新的div.而不是按钮我想插入我自己的文本/图像,让他们以相同的方式工作,揭示和隐藏新窗口.

这是jquery:

<script>
    $(document).ready(function(){

        $(".buttons").click(function () {
        var divname= this.value;
          $("#"+divname).show("slow").siblings().hide("slow");
        });

      });
</script> 
Run Code Online (Sandbox Code Playgroud)

这是我希望更改为aa href标签的其中一个按钮的代码.

<input type="button" id="button1" class="buttons" value="div1"></input>
Run Code Online (Sandbox Code Playgroud)

任何帮助将不胜感激.谢谢.皮娅

html jquery

0
推荐指数
1
解决办法
7638
查看次数

在链接悬停上显示图像

我在列表中有许多名称,如下所示:

<div class="names">
  <ul>
    <li><a href=#name1">name1</a></li>
    <li><a href=#name2">name2</a></li>
    <li><a href=#name3">name3</a></li>
    <li><a href=#name4">name4</a></li>
    <li><a href=#name5">name5</a></li>
  </ul>
</div>
Run Code Online (Sandbox Code Playgroud)

我想在光标旁边显示一个与鼠标悬停时每个名称相关的图像缩略图.这有可能与jquery?

谢谢堆.皮娅

javascript jquery image hover

0
推荐指数
1
解决办法
6169
查看次数

标签 统计

javascript ×3

html ×2

jquery ×2

popup ×2

facebook ×1

hover ×1

image ×1

popupwindow ×1

social ×1

xhtml ×1