Puika1 Posted March 10, 2010 Report Share Posted March 10, 2010 (edited) sveiki,ka saja scripta uzlikt,lai uzspiezot uz bildes vins atveras ar rami ka logs <?php $url = "/img/pics/"; $monImage = "$url"."1.jpg"; $tueImage = "$url"."2.jpg"; $wedImage = "$url"."t3.jpg"; $thurImage = "$url"."4.jpg"; $friImage = "$url"."5.jpg"; $weekendImage = "$url"."6.jpg"; $d = date("D"); switch ($d) { case Mon: echo "<img src=$monImage width=160 height=170>\n"; break; case Tue: echo "<img src=$tueImage width=160 height=170>\n"; break; case Wed: echo "<img src=$wedImage width=160 height=170>\n"; break; case Thu: echo "<img src=$thurImage width=160 height=170>\n"; break; case Fri: echo "<img src=$friImage width=160 height=170>\n"; break; default: echo "<img src=$weekendImage width=160 height=170>\n"; } ?> Ui atvainojos par diviem topikiem,man nets nokaras! Edited March 10, 2010 by Puika1 Quote Link to comment Share on other sites More sharing options...
briedis Posted March 10, 2010 Report Share Posted March 10, 2010 Ir stilīgi likt pēdiņas tur kur nevajag (vienu pašu mainīgo pēdiņās) un nelikt pēdiņas tur, kur vajag switch case izteiksmēm. HTML atribūtiem arī ir jāliek pēdiņas. Tev laikam būs nepieciešams kaut kāds fancybox vai kas tāds... http://fancybox.net/ Quote Link to comment Share on other sites More sharing options...
Puika1 Posted March 10, 2010 Author Report Share Posted March 10, 2010 ja,bet es gribetu vecmodigo variantu Quote Link to comment Share on other sites More sharing options...
briedis Posted March 10, 2010 Report Share Posted March 10, 2010 (edited) ja,bet es gribetu vecmodigo variantu un tas būtu? <img onclick="window.open('bilde.jpg','_blank','width=200,height=200');" src=".." /> Edited March 10, 2010 by briedis Quote Link to comment Share on other sites More sharing options...
2easy Posted March 10, 2010 Report Share Posted March 10, 2010 (edited) šitais brīnumskripts jau kkur ir redzēts! :D tikai jautājums šoreiz laikam ir cits... Edited March 10, 2010 by 2easy Quote Link to comment Share on other sites More sharing options...
php newbie Posted March 10, 2010 Report Share Posted March 10, 2010 laikam tā: echo "<img src=$monImage width=160 height=170 target='_blank'>\n"; Quote Link to comment Share on other sites More sharing options...
briedis Posted March 10, 2010 Report Share Posted March 10, 2010 (edited) laikam tā: echo "<img src=$monImage width=160 height=170 target='_blank'>\n"; galīgi garām. Target ir a taga atribūts, kas norāda, ko darīt, kad uzspiež uz saites - vērt jaunā logā, vai tajā pašā, vai kāda freimā... Edited March 10, 2010 by briedis Quote Link to comment Share on other sites More sharing options...
php newbie Posted March 10, 2010 Report Share Posted March 10, 2010 laikam pagaidam es labāk tikai uzdošu jautājumus :) domāju to img ielikt a tag'ā Quote Link to comment Share on other sites More sharing options...
briedis Posted March 10, 2010 Report Share Posted March 10, 2010 laikam pagaidam es labāk tikai uzdošu jautājumus :) domāju to img ielikt a tag'ā Ielikt a tagā, un piemest to target - tā gan var... Semantiski tas pat būtu labāks variants. Varētu arī veikt gadījumu, kad JS ir izslēgts. <a href="bilde.jpg" target="_blank" onclick="window.open('bilde.jpg','_blank','width=400, height=200'); return false;"><img src="bilde.jpg" alt="Alternatīvs teksts" /></a> (pie linka onclick beigās ir return false. Tas nodrošina, ka netiks atvērts href ceļš. Ja JS izslēgts, onclick nenostrādās, bet nostrādās tikai href atribūts) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.