Kufufuza: Chida Chowonera Maimelo Paintaneti

Kodi mudazindikira kuti ndi maimelo angati omwe amaletsa zithunzi ndikuwonetsa zina? Ndili ndi chidwi chofuna kudziwa ngati pali amene wawonapo izi akugwiritsa ntchito JavaScript kapena Server-side scripting. Ndikufuna kutenga chida chomwe chimagwira. Popita nthawi, ndikutsimikiza kuti nditha kupanga tsamba lotere ... Ndayamba kusewera usikuuno. Nayi ntchito yomwe imachotsa zithunzi zanu zonse patsamba:

ntchito m'malo () // chotsani zithunzi
{
var imgs = document.getElementsByTagName ('img'); // mndandanda
for (var i = 0; i> imgs.length; i ++) // kuzungulira
{
imgs [i] .src = "" "; // sankhani mafano kukhala opanda pake
}
}

Ndi Javascript yosavuta. Chinthu choyamba chimene ndimachita ndikusonkhanitsa zithunzi mu HTML. Gulu ndi gulu la zinthu. Ndidauza JavaScript kuti itenge chilichonse chomwe chili ndi img tag. (Umu ndi momwe mumawonetsera zithunzi mu HTML). Chotsatira ndimadzipukusa ndikumuuza kuti ayambe ndi chinthu choyamba (= 0), pitani pazinthu zambiri zomwe zilipo (imgs.length), ndipo mukamaliza ndi kuzungulira onjezani 1 kuti musunthire ku chinthu chotsatira (i ++).

Zomwe zimachitika ndikuti gulu limasonkhanitsa malo omwe chithunzi chili patsamba, ndikudutsa, ndikuyika chilichonse pachabe. Zomwe ndikufuna kuchita ndi kuchotsa chithunzichi koma ndikuwonetsa zina zilizonse - monga momwe imelo imelo imathandizira. Ndingakondenso kuchotsa tebulo lina ndi ma div kuti liwapatse momwe lingayang'anire mu Makasitomala Ambiri Amakono. Izi zingalowe m'malo mwa zilembo zamkati ndi mawonekedwe.

Kodi pali amene wawonapo kapena wamanga chonga ichi? Ngati ndi choncho, ndilembereni fomu yothandizira. Ngati zalembedwa mu C # kapena makamaka JavaScript, itha kukhala chinthu chomwe ndingaloledwe kugula. Ubwino wa JavaScript ndikuti imatha kuzimitsidwa mwamphamvu - chinthu chabwino kwambiri! Pakadali pano, ndipitilizabe kukonza ndekha!

9 Comments

  1. 1

    Icho chikanakhala chosavuta kwenikweni Greasemonkey javascript

    Muli pafupi, ingoikani chizindikiro cha alt ngati NextSibling.

    kenaka ikani pazogwiritsa ntchito.org 🙂

    Muthanso kugwiritsa ntchito Greasemonkey ku XPI kapena chilichonse chomwe chimatchedwa kuti chikhale chowonjezera choyenera cha Firefox.

  2. 2

    Wawa Doug,

    The Toolbar Yotsatsira Webusayiti ili ndi chida chochitira izi makamaka, chotchedwa "Sinthanitsani Zithunzi Ndi Zizindikiro za Alt". Zimachita ndendende zomwe mukufuna kwaulere!

    Inapanganso vuto lofikira ndi tsamba lanu ngakhale. Kuzimitsa zithunzi kumasiya mawu akuda, kotero aliyense amene akuyang'ana pa intaneti popanda zithunzi sangawerenge zolemba zanu!

    Powonjezera:

    .post { background-color:#fff; }

    ziyenera kuthetsa izi osasokoneza mutu wanu ngakhale.

    • 3

      Kupeza kwakukulu ndi kugwira, Phil! Zikomo kwambiri. Ndikufuna kuwonjezera zojambulazi pang'ono chifukwa ndikufuna zina mwazomwe zili patsamba osati msakatuli weniweniwo. Zabwino kwambiri!

      (Ndinasinthanso kalasi yanga yaposachedwa - zikomo posonyeza izi!)

  3. 4

    Ku Agency.com timagwiritsa ntchito chinthu chotchedwa pvIQ kuchokera ku Pivotal Veracity (http://pivotalveracity.com/solutions/pvIQ.php) ndiwothandiza kwambiri pamavuto anu. Timatumiza maimelo athu oyeserera kumaakaunti athu osiyanasiyana a ISP kenako pvIQ imapezanso ma jpgs a maimelo omwe atumizidwa kuchokera kumaakaunti onse, momwe amawonekera m'masakatuli osiyanasiyana. Izi zimatipulumutsira nthawi yochulukirapo, popeza zonse zomwe tiyenera kuchita ndikuyang'ana ma jpgs omwe amatuluka. Ndimalangiza.

    • 5

      Moni Mako,

      Chowonadi Chachikulu chili ndi zida zina zabwino! Ndikudziwa kuti ayambitsanso API posachedwa. Ndikuyesera kuchita china chosavuta, kungoyang'ana mwachangu komwe sikutanthauza kutumiza imelo kunja. Ingoganizirani batani lokha kuti mungodina ndipo mutha kutsanzira momwe zingawonekere, kungosamalira zipatso zotsalira.

      Doug

      • 6

        Hi,

        Sindinayang'ane izi kwakanthawi, kuti ndikhoze kukhala ndikulakwitsa, koma kodi ma portal sakusintha pulogalamu yawo yotumiza makalata? Akadatero, ndikadaganiza kuti mumangokhalira kusewera ngati mungayese kugwiritsa ntchito pulogalamu yanu yoyeserera. Ichi ndichifukwa chake timagwiritsa ntchito pvIQ: zimatitumizira zomwe tsambalo lingapereke.

        Mark

        • 7

          Mukulondola mwamtheradi. Maganizo anga ndikungopanga chowonera mwachangu & chodetsa chomwe wina angachite asanatumize ku zinthu ngati pvIQ… zinthu monga ma tag a Alt ndikuwonetseratu mafoni (matebulo achotsedwa, ndi zina zambiri). Ine sindikufuna kuti ndiyese kuyesetsa kuti ndizikhala ndi chisokonezo kunja uko ndi Makasitomala Amelo! Anthu amenewo ku Chowonadi Chachikulu ndi omwe amachita zabwino pamenepo!

          Doug

  4. 8

    Chinachake chonga ichi?

    var showImages = false;
    function toggleImages() {
    var imgs = document.getElementsByTagName("img");
    for (var i=0;i

  5. 9

    Ndikuganiza kuti chowonjezera chomwe chingakhale chothandiza pamalingaliro anu chikhoza kukhala kuwonanso maimelo mofanananso ndi momwe makasitomala ambiri amaimelo amachitira. Zingatenge nthawi ndikufufuza momwe aliyense amachitira (ndi zinthu ziti zomwe amavula, kusiya, ndi zina).

    Mumapanga zosefera zingapo zoti musankhe. Nenani, fyuluta ya GMail, Yahoo Mail, Outlook (PC, Mac, ndi zina), zosefera, ndi zina zambiri. Kotero, m'malo mokhala ndi ma dummy test account ndi ntchito iliyonse pansi pano, mutha kuyendetsa pang'onopang'ono.

    … Mwina ndanena zambiri… 😉

Mukuganiza chiyani?

Tsambali likugwiritsa ntchito Akismet kuchepetsa spam. Phunzirani momwe deta yanu ikufotokozera.