Easy Resizer!

Discutii despre tot ce nu se incadreaza in celelalte categorii.

Moderators: Moderatori ajutatori, Moderatori

vim
Programator eXtream
Programator eXtream
Posts: 845
Joined: 29 May 2009, 18:13
Detinator Steam: Da
CS Status: Trag cu praştia !
Reputatie: Fost programator web eXtreamCS
Administrator tehnic
Sysadmin
Location: Bucureşti
Has thanked: 2 times
Been thanked: 329 times

29 Aug 2010, 08:12

FyNNN wrote:Face la fel, doar ca deschide intr-o fereastra mai mica :((
Hai ca am priceput ce vroiai.

Inlocuieste codul care ti l`am dat anterior cu:

Code: Select all

<script type="text/javascript">
// <![CDATA[
window.onload = resizeimg;
function resizeimg()
{
   if (document.getElementsByTagName)
   {
      for (i=0; i<document.getElementsByTagName('img').length; i++)
      {
         im = document.getElementsByTagName('img')[i];
         if (im.width > 600)
         {
            im.style.width = '540px';
            im.style.height = '400px';
            eval("pop" + String(i) + " = new Function(\"pop = window.open('" + im.src + " ','fullscale','width="+ im.width +",height="+ im.height +",scrollbars=1,resizable=1'); pop.focus();\")");
            eval("im.onclick = pop" + String(i) + ";");
            if (document.all) im.style.cursor = 'hand';
            if (!document.all) im.style.cursor = 'pointer';
            im.title = 'Click Here To See Image Full Size ';
         }
      }
   }
}
// ]]>
</script>
I'm not antisocial, I'm just not user friendly.
User avatar
FyNNN
Membru, skill +3
Membru, skill +3
Posts: 1421
Joined: 09 May 2010, 13:43
Detinator Steam: Da
CS Status: Shhht guritza !
Detinator server CS: Nu
SteamID: mircea_fynn
Reputatie: Membru Club eXtreamCS (o luna)
Ban 3 luni!
Location: Arad
Has thanked: 123 times
Been thanked: 164 times
Contact:

29 Aug 2010, 09:16

Acum, se deschd 2 ferestre, si bannerul e cat casa =)
vim
Programator eXtream
Programator eXtream
Posts: 845
Joined: 29 May 2009, 18:13
Detinator Steam: Da
CS Status: Trag cu praştia !
Reputatie: Fost programator web eXtreamCS
Administrator tehnic
Sysadmin
Location: Bucureşti
Has thanked: 2 times
Been thanked: 329 times

30 Aug 2010, 19:15

FyNNN wrote:Acum, se deschd 2 ferestre, si bannerul e cat casa =)
Bannerul il poti incarca prin iframe sau cereri asincrone, iar 2 ferestre se deschid pentru ca ai de 2 ori codul inserat in pagina.
I'm not antisocial, I'm just not user friendly.
User avatar
FyNNN
Membru, skill +3
Membru, skill +3
Posts: 1421
Joined: 09 May 2010, 13:43
Detinator Steam: Da
CS Status: Shhht guritza !
Detinator server CS: Nu
SteamID: mircea_fynn
Reputatie: Membru Club eXtreamCS (o luna)
Ban 3 luni!
Location: Arad
Has thanked: 123 times
Been thanked: 164 times
Contact:

30 Aug 2010, 19:48

Aha, totusi cum fac sa nu se deschida si banneru .
vim
Programator eXtream
Programator eXtream
Posts: 845
Joined: 29 May 2009, 18:13
Detinator Steam: Da
CS Status: Trag cu praştia !
Reputatie: Fost programator web eXtreamCS
Administrator tehnic
Sysadmin
Location: Bucureşti
Has thanked: 2 times
Been thanked: 329 times

31 Aug 2010, 08:45

FyNNN wrote:Aha, totusi cum fac sa nu se deschida si banneru .
Trebuie sa modifici codul JS astfel incat sa ignore respectiva imagine. Poti face asta prin atribuirea unui anumit id acelui banner, dupa care modifici codul JS astfel incat ca atunci cand este intalnit acel id, sa ignore respectiva poza.

Code: Select all

<script type="text/javascript">
// <![CDATA[
window.onload = resizeimg;
function resizeimg()
{
   if (document.getElementsByTagName)
   {
      for (i=0; i<document.getElementsByTagName('img').length; i++)
      {
         im = document.getElementsByTagName('img')[i];
         if (im.width > 600)
         {
			if (im.id == "noresize") { return; }
			
			im.style.width = '540px';
			im.style.height = '400px';
			eval("pop" + String(i) + " = new Function(\"pop = window.open('" + im.src + " ','fullscale','width="+ im.width +",height="+ im.height +",scrollbars=1,resizable=1'); pop.focus();\")");
			eval("im.onclick = pop" + String(i) + ";");
			if (document.all) im.style.cursor = 'hand';
			if (!document.all) im.style.cursor = 'pointer';
			im.title = 'Click Here To See Image Full Size ';
         }
      }
   }
}
// ]]>
</script>
La imaginea bannerului adaugi id="noresize" pentru a impiedica redimensionarea.

Exemplu:

Code: Select all

<img src="http://img29.imageshack.us/img29/4176/mare.jpg" id="noresize">
Spor.
I'm not antisocial, I'm just not user friendly.
User avatar
FyNNN
Membru, skill +3
Membru, skill +3
Posts: 1421
Joined: 09 May 2010, 13:43
Detinator Steam: Da
CS Status: Shhht guritza !
Detinator server CS: Nu
SteamID: mircea_fynn
Reputatie: Membru Club eXtreamCS (o luna)
Ban 3 luni!
Location: Arad
Has thanked: 123 times
Been thanked: 164 times
Contact:

01 Sep 2010, 17:35

Nu merge :)
UP!

@Imi poti da ID-ul tau sa ma ajuti prin TW?
Post Reply

Return to “Discutii generale”

  • Information