You must be logged in to post Login


Lost Your Password?

Search Forums:


 






Minimum search word length is 4 characters – Maximum search word length is 84 characters
Wildcard Usage:
*  matches any number of characters    %  matches exactly one character

Code snippet for yoooooou

No Tags
UserPost

8:14 am
August 1, 2013


Jenny @ FrugalGuruGuide

Member

posts 78

I want to have my main menu's items' individual widths constrained.  You can't do that with using CSS styling on the li's directly because they're inline-level elements (hear me scream), so I figured out how to wrap each link element with a div.  Using CSS, you can then set the divs to inline-block and give the widths.  Here's the snippet that grabs all the links inside an li that are dynamically generated by wordpress and wraps them in divs that plays nicely with WP.

 

jQuery.noConflict();
function wrapLists(){
jQuery('li a').wrap('<b><div class="list-item"></div></b>');
}
window.onload=wrapLists;
 
:)

8:15 am
August 1, 2013


Jenny @ FrugalGuruGuide

Member

posts 78

Oh, BTW, the <b> wasn't necessary at all.  Ooops.

No Tags

About the Yakezie.com Forum

Forum Timezone: America/Los_Angeles

Forum Stats:

Groups: 2
Forums: 9
Topics: 6383
Posts: 84794

Membership:

There are 13651 Members
There have been 20 Guests

There are 9 Admins
There are 8 Moderators

Top Posters:

My Personal Finance Journey – 3159
Khaleef @ KNS Financial – 3149
Budgeting in the Fun Stuff – 3048
Sustainable PF – 2759
Miss T @ Prairie Eco-Thrifter – 2213
Eric – PersonalProfitability.com – 2120

Administrators: The College Investor (1935 Posts), Financial Samurai (1803 Posts), LaTisha @YoungFinances (1715 Posts), Forest Parks (1337 Posts), 20s Finances (1147 Posts), Money Reasons (697 Posts), Chris Johnson (78 Posts), Sydney at Untemplater (0 Posts), Suba (0 Posts)

Moderators: Suba @ Wealth Informatics (1876 Posts), sooverthis (1041 Posts), PK @ DQYDJ (361 Posts), jmichelsen (208 Posts), Ramona (13 Posts), JeremyNJohnson (4 Posts), Moderator (0 Posts), rackgeek (0 Posts)