courage Posted July 23, 2006 Report Share Posted July 23, 2006 Sveiki, es censos uztaisit tadu lietu kad lapa ir kada bilde un uzspiezot kadu noteiktu pogu varetu samazinat bildi. kods kuru esmu uzlicis: <select OnChange="Update();" name="size"> <option value="0" selected>Pilns izmers</option> <option value="0" selected>Mazais izmers</option> </select> un javascript kas updato izmerus <script language="javascript"> var user; var bg; var size; var mpimage_url; function Update() { if (!document.getElementById) return true; var username_elem = document.forms['f'].username; user = username_elem.value; var background_elem = document.forms['f'].background; bg = background_elem.value; var size_elem = document.forms['f'].size; size = size_elem.value; var mpimage = document.getElementById('mpimage'); mpimage.src="http://sh.cf.lv/pstag/" + bg + "wID=" + size + "" + user + ".jpg"; var link_elem = document.getElementById('mpimage_link'); link_elem.href = "http://sh.cf.lv/stats/player.php?id=" + user; var mpimage_test = document.getElementById('mpimage_test'); mpimage_test.src="http://sh.cf.lv/pstag/" + bg + "wID=" + "137" + ".jpg"; var width; var height; width = 550; height = 150; if (size == 1) { width = 277; height = 63; } if (size == 2) { width = 450; height = 34; } if (size == 3) { width = 149; height = 29; } var htmlcode_elem = document.forms['f2'].htmlcode; htmlcode_elem.value = "<a href=" + link_elem.href + "><img src=" + mpimage.src + " width=" + width + " height=" + height + "></a>"; var bbcode_elem = document.forms['f3'].bbcode; bbcode_elem.value = "[url=" + link_elem.href + "][img=" + mpimage.src + "][/url]"; return true; } </script> esmu sho script nozadzis tapec nebrinaties kad nezinu :) Link to comment Share on other sites More sharing options...
john.brown Posted July 23, 2006 Report Share Posted July 23, 2006 Klau, varbūt pietiks bombardēt mūs ar milzu palagiem, par kuru darbību pats galīgi neko nezini? Un, kāds, interesanti, jautājums? Izstāstīt tev, kā viņš dabojas? :D Link to comment Share on other sites More sharing options...
courage Posted July 23, 2006 Author Report Share Posted July 23, 2006 es nebombardeju! vienkarsi paprasu help! script nesamazina bildi! Link to comment Share on other sites More sharing options...
v3rb0 Posted July 23, 2006 Report Share Posted July 23, 2006 (edited) bet vai iepriekš tas scripts samazināja bildi? jeb to tik tā izdomāji ka šo nokopēšu no kaut kurienes un šis nu tā ņems un samazinās? ja dod tādus palagus, tad bik vairāk aprakstu par problēmu vajag - kas tieši tur aplami. Edited July 23, 2006 by v3rb0 Link to comment Share on other sites More sharing options...
courage Posted July 23, 2006 Author Report Share Posted July 23, 2006 vinam vajadzeja samazinat, bet izskatas kad to nedara! Link to comment Share on other sites More sharing options...
john.brown Posted July 24, 2006 Report Share Posted July 24, 2006 (edited) un kas tev šitas ira? <select OnChange="Update();" name="size"> <option value="0" selected>Pilns izmers</option> <option value="0" selected>Mazais izmers</option> </select> Un kā tas iet kopā ar šito? if (size == 1) { width = 277; height = 63; } if (size == 2) { width = 450; height = 34; } if (size == 3) { width = 149; height = 29; } Edited July 24, 2006 by john.brown Link to comment Share on other sites More sharing options...
goldy Posted July 24, 2006 Report Share Posted July 24, 2006 vinam vajadzeja samazinat, bet izskatas kad to nedara! šis ir labs, bet varbūt arī samazina ko? Link to comment Share on other sites More sharing options...
courage Posted July 25, 2006 Author Report Share Posted July 25, 2006 atklaju kad trukst viens mazs kodins! pie bildes nav neka kas vinu samazina <textarea cols="75" rows="4" readonly name="htmlcode" size="120" value=""></textarea> pie value nav neka! kads zin kadam kodam butu jabut tur? Link to comment Share on other sites More sharing options...
Recommended Posts