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.

moving the forums with javascript

View previous topic View next topic Go down

Solved moving the forums with javascript

Post by dejanpetrus on August 27th 2012, 12:31 pm

I have code in java script, had the css but I lost so please if you could help me to write the CSS code?
here is the script for phpbb3 forums...select in all pages

Code:
$(function(){$(function(){save=true;safe=true;show=["slideDown",500];hide=["slideUp",500];event="click";defaut=add("cel forum");add("diskusija",[1]);add("novosti",[2]);add("kardshering",[4]);add("klucevi",[5]);add("Design",[6]);add("Informática",[7]);add("Entretenimento",[8]);add("Ocultar tudo",[10]);conteneur_tabs("before",".cat-table:first")});$(function(){var a;if(save&&window.localStorage&&(a=localStorage.getItem("tabs"))&&(a=u(a)))defaut=a;$(".cat-table").filter(function(a){return!z(defaut,a)}).hide();for(a=0;a<v.length;a++)$(".cat-tabs").append('<div class="ct-item'+(v[a]==defaut?" ct-active":"")+'">'+(safe?v[a][0].replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"):v[a][0])+"</div>");$(".cat-tabs").on(event,".ct-item",function(){$(".cat-tabs .ct-active").removeClass("ct-active");var a=$(this).parent().children().index(this);$(".cat-tabs").each(function(){$(this).children().eq(a).addClass("ct-active")});var c=v[a];$(".cat-table").not($(".cat-table").filter(function(a){return z(c,a)})[show[0]](show[1]))[hide[0]](hide[1]);save&&window.localStorage&&localStorage.setItem("tabs",JSON.stringify(c))})});var hide,show,save,safe,event,timeslide,defaut,v=[],w=["th.secondarytitle","div.table-title h2","div.page-title h2","div.maintitle h2"],x=["table","div.forabg","div.main-head","div.borderwrap"],y=[null,null,"div.main-content",null],ver=function(){return $("#phpbb").length?1:$("#pun-intro").length?2:$("#ipbwrapper").length?3:0},add=function(a,b){if(1==arguments.length)if("number"==typeof a)if(0<=a&&$(w[ver()]).length>=a+1)a=$(w[ver()]).eq(b=a).text();else return;else if("string"==typeof a)for(var b=[],c=0;c<$(w[ver()]).length;c++)b.push(c);v.push([a,"number"==typeof b?[b]:b]);return v[v.length-1]},u=function(a){for(var b=0;b<v.length;b++)if(JSON.stringify(v[b])==a)return v[b];return!1},conteneur_tabs=function(a,b){$(b)[a]('<div class="cat-tabs"></div>')},z=function(a,b){for(var c=0;c<a[1].length;c++)if(a[1][c]==b)return!0;return!1};$(w[ver()]).closest(x[ver()]).each(function(){$(this).add(y[ver()]).wrapAll('<div class="cat-table" />')})});

help me and sorry for bad English

dejanpetrus
New Member

Posts : 23
Reputation : 1
Language : macedonien

http://www.mkd-satelite.forummk.com

Back to top Go down

Solved Re: moving the forums with javascript

Post by Nera. on August 27th 2012, 12:35 pm

Hi Macedonia,

Searching for toogle categories BB3?

@enlil wrote:hi,


an example of script to use on index :

Code:
$(function() {
  $("div.table-title").closest("div.forabg").addClass("cat-table").first().before('<div id="cat-tabs"></div>');
  $(".cat-table:not(:first)").hide();
  $("div.table-title h2").each(function() {
    $("#cat-tabs").append('<div class="ct-item">' + $(this).text() + "</div>")
  });
  $("#cat-tabs .ct-item").click(function() {
    $("#cat-tabs .ct-abled").removeClass("ct-abled");
    $(this).addClass("ct-abled");
    $(".cat-table").not($(".cat-table").eq($("#cat-tabs .ct-item").index(this)).slideDown(500)).slideUp(500)
  }).first().addClass("ct-abled")
});
And the css :

Code:
#cat-tabs { text-align: center; margin: 10px auto; }
#cat-tabs .ct-item { display: inline; background: blue; color: #fff; margin: 5px; padding: 5px;  }
#cat-tabs .ct-abled { color: blue; background: #fff; }
you can improve the css. on this forum it looks like this :


otherway, to my taste it's bad to do this ( you need to browse all category to see new messages )

Nera.
Energetic

Female Posts : 7077
Reputation : 2013
Language : English
Location : -

http://webartzforum.com

Back to top Go down

Solved Re: moving the forums with javascript

Post by dejanpetrus on August 27th 2012, 12:59 pm

Thank Nera but if you can my script code put

dejanpetrus
New Member

Posts : 23
Reputation : 1
Language : macedonien

http://www.mkd-satelite.forummk.com

Back to top Go down

Solved Re: moving the forums with javascript

Post by DarkGlow on August 27th 2012, 1:31 pm

@dejanpetrus wrote:Thank Nera but if you can my script code put

Put the first code in your JavaScript code, my friend.

ACP > Modules tab > JavaScript code management.

DarkGlow
Forumember

Male Posts : 629
Reputation : 92
Language : English | Hebrew | Arabic
Location : Israel

Back to top Go down

Solved Re: moving the forums with javascript

Post by dejanpetrus on August 27th 2012, 2:00 pm

that's true but it works well.I need a css code
mkd-satelite.forummk.com

dejanpetrus
New Member

Posts : 23
Reputation : 1
Language : macedonien

http://www.mkd-satelite.forummk.com

Back to top Go down

Solved Re: moving the forums with javascript

Post by dejanpetrus on August 27th 2012, 2:08 pm

solved Hello

dejanpetrus
New Member

Posts : 23
Reputation : 1
Language : macedonien

http://www.mkd-satelite.forummk.com

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