Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CSS Buttons and other things
#26
Your luck is in today Lee; check out ./jscripts/general.js - inside this file is a Cookie function you can use to get, set and remove cookies. The functionality is already built into MyBB.

(2012-06-21, 07:07 PM)brad-t Wrote: Tomm, mind sharing the JS changes you made? Would like to make my mq button pure CSS too

Certainly; I do use a PNG icon but I switch classes instead of icons in the JS.

Open ./jscripts/thread.js. Find the following:

Line 19: element.src = element.src.replace("postbit_multiquote.gif", "postbit_multiquote_on.gif");
Line 52: element.src = element.src.replace("postbit_multiquote.gif", "postbit_multiquote_on.gif");
Line 57: element.src = element.src.replace("postbit_multiquote_on.gif", "postbit_multiquote.gif");
Line 138: element.src = element.src.replace("postbit_multiquote_on.gif", "postbit_multiquote.gif");

Replace with:

Line 19: element.addClassName("multiquote_on");
Line 52: element.addClassName("multiquote_on");
Line 57: element.removeClassName("multiquote_on");
Line 138: element.removeClassName("multiquote_on");

So, basically it will change whatever element has the 'multiquote' id; for example my layout:

<span class="button multiquote" id="multiquote_1">
     <a href="x"><span>Quote</span></a>
</span>

This then becomes the following when activated:

<span class="button multiquote multiquote_on" id="multiquote_1">
     <a href="x"><span>Quote</span></a>
</span>

The multiquote_on class overwrites the background image in my multiquote class.

Viola.


Messages In This Thread
CSS Buttons and other things - by Solstice - 2012-06-15, 05:27 AM
RE: CSS Buttons - by martec - 2012-06-15, 05:45 AM
RE: CSS Buttons and other things - by Tomm M - 2012-06-15, 06:40 AM
RE: CSS Buttons and other things - by Solstice - 2012-06-15, 06:55 AM
RE: CSS Buttons and other things - by Jack Clarke - 2012-06-15, 02:51 PM
RE: CSS Buttons and other things - by Tomm M - 2012-06-15, 04:43 PM
RE: CSS Buttons and other things - by Omar G. - 2012-06-16, 04:26 AM
RE: CSS Buttons and other things - by brad-t - 2012-06-16, 04:45 AM
RE: CSS Buttons and other things - by Jack Clarke - 2012-06-16, 10:55 AM
RE: CSS Buttons and other things - by Omar G. - 2012-06-16, 02:30 PM
RE: CSS Buttons and other things - by brad-t - 2012-06-16, 03:46 PM
RE: CSS Buttons and other things - by Jack Clarke - 2012-06-16, 08:53 PM
RE: CSS Buttons and other things - by Sector - 2012-06-19, 12:53 AM
RE: CSS Buttons and other things - by Jack Clarke - 2012-06-20, 11:13 PM
RE: CSS Buttons and other things - by Sector - 2012-06-21, 12:39 AM
RE: CSS Buttons and other things - by Jack Clarke - 2012-06-21, 01:03 AM
RE: CSS Buttons and other things - by Sector - 2012-06-21, 01:59 AM
RE: CSS Buttons and other things - by Tomm M - 2012-06-21, 07:48 AM
RE: CSS Buttons and other things - by Sector - 2012-06-21, 03:02 PM
RE: CSS Buttons and other things - by Jack Clarke - 2012-06-21, 03:14 PM
RE: CSS Buttons and other things - by Tomm M - 2012-06-21, 03:21 PM
RE: CSS Buttons and other things - by Sector - 2012-06-21, 04:06 PM
RE: CSS Buttons and other things - by Tomm M - 2012-06-21, 05:05 PM
RE: CSS Buttons and other things - by Leefish - 2012-06-21, 08:35 PM
RE: CSS Buttons and other things - by brad-t - 2012-06-21, 07:07 PM
RE: CSS Buttons and other things - by Tomm M - 2012-06-21, 09:59 PM
RE: CSS Buttons and other things - by brad-t - 2012-06-21, 10:07 PM
RE: CSS Buttons and other things - by martec - 2012-06-21, 10:54 PM
RE: CSS Buttons and other things - by Tomm M - 2012-06-21, 11:04 PM
RE: CSS Buttons and other things - by martec - 2012-06-21, 11:10 PM
RE: CSS Buttons and other things - by Leefish - 2012-08-29, 07:49 PM
RE: CSS Buttons and other things - by Tomm M - 2012-08-29, 08:49 PM
RE: CSS Buttons and other things - by Leefish - 2012-08-29, 09:17 PM
RE: CSS Buttons and other things - by adbrad - 2013-04-29, 06:08 PM
RE: CSS Buttons and other things - by The90sKid - 2013-05-05, 02:15 PM
RE: CSS Buttons and other things - by brad-t - 2013-06-08, 09:00 PM
RE: CSS Buttons and other things - by Leefish - 2013-06-08, 10:53 PM
RE: CSS Buttons and other things - by brad-t - 2013-06-09, 01:11 AM
RE: CSS Buttons and other things - by Leefish - 2013-06-09, 01:14 AM
RE: CSS Buttons and other things - by brad-t - 2013-06-09, 01:15 AM
RE: CSS Buttons and other things - by Leefish - 2013-06-09, 01:36 AM
RE: CSS Buttons and other things - by brad-t - 2013-06-09, 02:03 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)