The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Forum Adjuster Widget

4 posters

Go down

Solved Forum Adjuster Widget

Post by Bingoo2 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
avatar
Bingoo2
New Member

Posts : 6
Reputation : 1
Language : English

Back to top Go down

Solved Re: Forum Adjuster Widget

Post by Michael_vx 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
Michael_vx
Forumember

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

Back to top Go down

Solved Re: Forum Adjuster Widget

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

Thank your for the code, but it doesn't work.
avatar
Bingoo2
New Member

Posts : 6
Reputation : 1
Language : English

Back to top Go down

Solved Re: Forum Adjuster Widget

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

oh sorry i will try better next time
Michael_vx
Michael_vx
Forumember

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

Back to top Go down

Solved Re: Forum Adjuster Widget

Post by Ange Tuteur 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
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Forum Adjuster Widget

Post by Bingoo2 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!
avatar
Bingoo2
New Member

Posts : 6
Reputation : 1
Language : English

Back to top Go down

Solved Re: Forum Adjuster Widget

Post by Ange Tuteur 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
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Forum Adjuster Widget

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

Thank you Ange! The new code you gave me works. Topic Solved.
avatar
Bingoo2
New Member

Posts : 6
Reputation : 1
Language : English

Back to top Go down

Solved Re: Forum Adjuster Widget

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

Solved
Jophy
Jophy
ForumGuru

Male Posts : 17922
Reputation : 836
Language : English
Location : Somewhere

Back to top Go down

Back to top

- Similar topics

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