簡體   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