繁体   English   中英

我想在网站页面上添加带有按钮的自定义窗口

[英]I want to add a custom window with buttons on a website page

我正在玩一个在线游戏,其按钮具有以下代码。 我要添加带有按钮的窗口的原因是,在页面(带有要单击的按钮)出现/加载之前,我必须浏览几个菜单。 因此,我不必在实际单击该按钮之前浏览几次菜单,而是计划制作一个带有虚拟按钮的窗口,该窗口将执行以下相同的代码。

<form accept-charset="utf-8" method="post" action="http://www.marketglory.com/account/fight/view_user/498">

    <input type="hidden" value="startFight" name="action"></input>
    <input type="hidden" value="trainer" name="username"></input>
    <input class="nd_submit_big mt13" type="submit" value="Atack now" name="test"></input>
</form>

游戏位于http://goo.gl/YyvS5o

在上面的操作链接上,userID为498。

我不知道从哪里开始。 这是我的开始脚本:

// ==UserScript==
// @name        MarketGold In a New Look
// @namespace   http://userscripts.org/scripts/edit_src/180590
// @description This script is intended to enhance the playing experience with the strategy game at http://www.marketglory.com
// @author      Wind™
// @include     http://*.marketglory.com/*
// @exclude     http://*.marketglory.com/forum/*
// @exclude     http://forum.marketglory.com/*
// @grant       GM_addStyle
// @version     1.0.1
// ==/UserScript==

/* Still no idea how to start this */

总结一下:

  1. 创建一个约200x80大小的可拖动窗口(如iframe或其他东西)。
  2. 创建一个虚拟按钮,它将执行我上面提到的代码。
//...
//@require http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js
//@require http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js
//...

$('<table/>').wrapInner($('input[value="Atack now"]').parent()).draggable().css({'padding':'20px', 'background':'black', 'opacity':'0.5'}).appendTo('body');

演示版

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM