jugoretz wrote:So I did some more poking around, and I think I figured out how to make this work.
I'll post it here to help anyone else who might need to try.
It's not too hard, but sure wasn't easy to figure out. You have to make edits to imageMenu.css and functions.php. If you want, you could probably do that with a child theme--that would be the best practice so you still get upgrades and don't lose your edits. I'm not going to explain how to do child themes. Lots of good explanations of that out there on the web.
Here's the plan:
In functions.php, it's just a change to a few numbers. On line 147 in functions.php, we find
- Code: Select all
if($item_count <=5)
That number 5 is based on the default seven items in the slider. We have to change that number to be two fewer than the number of items we will have in our modified version (because the numbering of items starts with 0, not with 1). So let's use a 10-item sliding menu as an example. For a 10-item sliding menu, we will write
- Code: Select all
(if($item_count <=8)
because 10 - 2 = 8.
Then on line 171, we will change the 6 in
- Code: Select all
if($item_count == 6)
to be one less than the total number of items we want to have.
So for a 10-item sliding menu we will write
- Code: Select all
(if($item_count == 9)
.
Last we will go to line 182 and find
- Code: Select all
li class="bk6"
. We will change that six to be one number less than the number of items again.
So for the 10-item slider it will change to
- Code: Select all
li class="bk9"
Then we will turn to imageMenu.css . Here we need to do a little arithmetic. First we need to go to line 41. This is where we find the width for
- Code: Select all
#imageMenu ul li a
. This is 133px for the default seven-item slider. 133 x 7 = 931. That's our total width.
We need to change the width for each item in our new 10-item slider so they will all fit in that 931 total, so divide 931 by the number of items we want to have. In the 10-item slider, then, we get 931 divided by 10 = 93 , so that width in line 41 that should be changed to 93px. Except it would really be 93.1, and you can't really have fractions of a pixel. Beyond that, in the 10-item slider we now have more borders than we did in the seven-item slider, and each border takes up a pixel, so things are off even more. All that means that you will probably have to juggle the number of pixels a little bit.
In the 10-item slider, I found that 92 pixels instead of 93 was much better for the width. When I used 93, there was some strange crazy jiggling on hover on the tenth item in the slider. You'll need to play with that yourself--if you just add one image, or take away images, it might not be a problem. When you get up to 10, you definitely want 92px.
You also have to change line 52 of imageMenu.css . It gives the style for
- Code: Select all
#imageMenu ul li.bk6 a
.
But bk
6 will no longer be the last item in your slider. So that style would be applying to the wrong item. So we just change that bk6 to a number that is one less than the number of items we will have. In the case of my 10-item slider, that means it changes to bk9.
That's it. Everything else works well.