The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Forum Adjuster Widget

View previous topic View next topic Go down

Solved Forum Adjuster Widget

Post by Bingoo2 on March 29th 2014, 9:40 pm

Hey, so I got a cool code for adjusting forum width but I noticed it only works for phpBB2, can someone please make a code for punBB that I can still put in widgets? Thanks in advance Smile.

Code:
<script type="text/javascript">
jQuery(document).ready(function(){

jQuery("#posaljiwidth").click(function(){
var a=eval(document.getElementById("selektwidth").value);
var b=0;
jQuery("table.bodylinewidth").animate({width:a},1100, "linear");
if(a==1200){b=1;}
if(a==1300){b=2;}
if(a==1400){b=3;}
if(a==1500){b=4;}
if(a==1600){b=5;}
if(a==1700){b=6;}
if(a==1800){b=7;}
setkuki('bodylinewidthkuki',b,365);
});
});
</script>
<center>
   
   <div style="text-align: center;"><input id="posaljiwidth" value="Set" type="submit" /><select id="selektwidth">
<option selected="selected">1200</option>
<option>1300</option>
<option>1400</option>
<option>1500</option>
<option>1600</option>
<option>1700</option>
<option>1800</option>
</select>
   </div>
</center>


Last edited by Bingoo2 on March 31st 2014, 8:36 pm; edited 1 time in total

Bingoo2
New Member

Posts : 6
Reputation : 1
Language : English

Back to top Go down

Solved Re: Forum Adjuster Widget

Post by Michael_vx on March 29th 2014, 9:53 pm

i have some thing like that but i did not have a chance to test on English forums its should also add widgets on the top and the battom of forums
the code is


Code:
 /* widgets top and down */
#content-container div#container {
width: auto;
float: none;
margin-left: auto;
}
#content-container div#main {
margin-right: auto;
margin-bottom: auto;
}
#content-container div#left {
width: auto;
float: none;
margin-left: auto;
}
#content-container div#right {
width: auto;
float: none;
margin-left: auto;
}
#main {
width: 990px;
}
#gfooter {
width: 990px;
}
#logostrip {
width: 990px;
}
#submenu {
width: 990px;
}
#userlinks {
width: 935px;
}
/* the end Michael_vx */
the last part is the size of desplay change it as you likei hope its works good

Michael_vx
Forumember

Male Posts : 655
Reputation : 29
Language : Arabic and some English
Location : Egypt

Back to top Go down

Solved Re: Forum Adjuster Widget

Post by Bingoo2 on March 29th 2014, 10:12 pm

Thank your for the code, but it doesn't work.

Bingoo2
New Member

Posts : 6
Reputation : 1
Language : English

Back to top Go down

Solved Re: Forum Adjuster Widget

Post by Michael_vx on March 29th 2014, 10:50 pm

oh sorry i will try better next time

Michael_vx
Forumember

Male Posts : 655
Reputation : 29
Language : Arabic and some English
Location : Egypt

Back to top Go down

Solved Re: Forum Adjuster Widget

Post by Ange Tuteur on March 30th 2014, 12:34 pm

Hello Bingoo2,

See if this works :
Code:
<script type="text/javascript">
  jQuery(document).ready(function(){
 
jQuery("#posaljiwidth").click(function(){
  var a=eval(document.getElementById("selektwidth").value);
  var b=0;
  jQuery(".pun").animate({width:a},1100, "linear");
  if(a==1200){b=1;}
  if(a==1300){b=2;}
  if(a==1400){b=3;}
  if(a==1500){b=4;}
  if(a==1600){b=5;}
  if(a==1700){b=6;}
  if(a==1800){b=7;}
  setkuki('bodylinewidthkuki',b,365);
  });
  });
  </script>
<center>
 
  <div style="text-align: center;"><input id="posaljiwidth" value="Set" type="submit" /><select id="selektwidth">
  <option selected="selected">1200</option>
  <option>1300</option>
  <option>1400</option>
  <option>1500</option>
  <option>1600</option>
  <option>1700</option>
  <option>1800</option>
  </select>
</div>
  </center>

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2683
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Forum Adjuster Widget

Post by Bingoo2 on March 30th 2014, 5:11 pm

Thank you Ange, for the code; however, it doesn't work on the forum I am co-administrating.

Link: http://ygoda.forumtl.com/

Also, this error came up- Uncaught ReferenceError: setkuki is not defined

Any help is much appreciated!

Bingoo2
New Member

Posts : 6
Reputation : 1
Language : English

Back to top Go down

Solved Re: Forum Adjuster Widget

Post by Ange Tuteur on March 31st 2014, 1:08 pm

Use this instead, I just noticed this was using eval, when you should use Number :
Code:
<script type="text/javascript">
  jQuery(document).ready(function(){
 
  jQuery("#posaljiwidth").click(function(){
  var a=Number(document.getElementById("selektwidth").value);
  var b=0;
  jQuery(".pun").animate({width:a},1100, "linear");
  if(a==1200){b=1;}
  if(a==1300){b=2;}
  if(a==1400){b=3;}
  if(a==1500){b=4;}
  if(a==1600){b=5;}
  if(a==1700){b=6;}
  if(a==1800){b=7;}
  });
  });
  </script>
  <center>
 
  <div style="text-align: center;"><input id="posaljiwidth" value="Set" type="submit" /><select id="selektwidth">
  <option selected="selected">1200</option>
  <option>1300</option>
  <option>1400</option>
  <option>1500</option>
  <option>1600</option>
  <option>1700</option>
  <option>1800</option>
  </select>
  </div>
  </center>

The code works fine for me, I'd check your CSS because I noticed your width was set as important. Look for something similar to/or containing :
Code:
.pun { width:87% !important }

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2683
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Forum Adjuster Widget

Post by Bingoo2 on March 31st 2014, 8:34 pm

Thank you Ange! The new code you gave me works. Topic Solved.

Bingoo2
New Member

Posts : 6
Reputation : 1
Language : English

Back to top Go down

Solved Re: Forum Adjuster Widget

Post by Jophy on April 1st 2014, 3:58 am

Solved

Jophy
ForumGuru

Male Posts : 17924
Reputation : 835
Language : English
Location : Somewhere

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum