Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Resize div
- // @namespace http://tampermonkey.net/
- // @version 0.1
- // @description try to take over the world!
- // @author You
- // @match http://forum.index.hu/Article/showArticle?t=9012640
- // @grant none
- // @require http://code.jquery.com/jquery-2.2.4.js
- // ==/UserScript==
- (function() {
- 'use strict';
- var nr;
- var id;
- $(".art_t").css('max-height', 350);
- $(".art_t").css('overflow: hidden', 350);
- $("<style type='text/css'> .popup-class{ position: fixed;top:0px; width:100%; background-color: white; height: 100%; z-index:1999} </style>").appendTo("head");
- $('<div/>', {
- id: 'popup',
- class: 'popup-class'
- }).appendTo('#maindiv');
- $("#popup").hide();
- var hsz;
- var lgt = $('#maintd .art_rat_lft').length;
- for (hsz = 0; hsz < lgt; hsz++) {
- (function() {
- var lft = document.getElementsByClassName("art_nr")[hsz];
- var myContent = lft;
- id = parseInt($(myContent).text());
- $(".art_h_r").eq(hsz).append('<div style="display: inline; cursor: pointer;" id="full_' + id + '">x</div>');
- $(".art_t").eq(hsz).attr('id', 'fullt_' + id);
- var target = 'fullt_' + id;
- $('#full_' + id).on('click', function() {
- fullsize(target)
- });
- }()); // immediate invocation
- }
- function fullsize(target) {
- $("#popup").empty();
- $(".art_t").css('max-height', '90%');
- var content = $("#" + target).clone();
- $("#popup").show();
- $("#popup").append(content);
- var gomb = '<button id="bezar">bezár</button>';
- $("#popup").append(gomb);
- $('#bezar').on('click', function() {
- pclose()
- });
- }
- function pclose() {
- $("#popup").hide();
- $(".art_t").css('max-height', 350);
- }
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement