JSFiddle - React, Tailwind, and code Playground

by dmethvin

JavaScript

// #4000 (webkit)

$(document).ready( function() {
    webKit();
    dothis("info","Settings on open: ");
});

var wheight = 240;
var wwidth = 800;
var ttop=10;

var note = "This problem occurs in web kit browsers - google chrome v1.0.154.43 and safari v3.2.1 (525.271.1) on windows XP,and safari 3.2.1 (4525.27.1) on mac OSX 10.4.11. Same behavior exists in jquery 1.2.6, 1.3, and 1.3.1<BR/><br/>Changing the height or width of a div through .animate will cause web kit browsers to lose their overflow property. 'open, close, grow,shrink, squeeze, expand' are all examples of this. Click 'info' after each to see 'overflow' is not in the properties list. You can see this in the element inspector in chrome / safari. To fix this you must reset the overflow property using .css after the animation finishes. The 'Webkit Fix' button demonstrates that with an instant change - fixshrink and fixgrow have timeouts that automatically reset the overflow after the animation delay.<BR/><br/>Instant height changes via CSS as shown by the insta grow / shrink buttons do not cause any problems if you're starting with a properly rendered div, but if the div is improperly rendered, it will remain broken because the insta grow / shrink functions do not reset overflow:auto.";

function addTool() {
    for(var i = 0; i<arguments.length; i++) {
    $('body').append('<div class=tool id='+arguments[i]+' style="top:'+ttop+'px;left:1px;position:absolute;border:1px solid black;">'+arguments[i]+'</div>');
    ttop += 25;
    }
};

function webKit() {
    addTool("info","grow","shrink","open","close","squeeze","expand","instagrow","instashrink","fixgrow","fixshrink");
    $('body').append('<div id=fix style="top:'+ttop+'px;left:1px;position:absolute;background-color:yellow;border:1px solid black;">Webkit Fix</div>');
    $('body').append('<div id=note style="height:150px; width:'+wwidth+'px;left:150px;overflow:auto;position:absolute;font-size:small;top:1px;">'+note+'</div>');
   ...