inherit
223470
0
Feb 27, 2019 17:05:53 GMT -8
₪» ⅀ ƪ Ƒ «₪
Original registration date: 2007. DeviantART: http://deviantart.com/ruanly. Discord: Ruanly#7946.
1,281
July 2015
fajita
|
Post by ₪» ⅀ ƪ Ƒ «₪ on Nov 13, 2019 13:19:45 GMT -8
I don't know a better title lol. I'm messing with javascript, and I'm notoriously horrible at it. My question is probably very simple, but I can't figure it out on google, it keeps giving me articles that are about something else, I apparently can't find the right way to word it.
So here's my snippet that I have:
$(document).ready(function(){ if(pb.data('route').name.match(/edit_user/)){ $(".description:contains('Your current email address is:')").next().next().next().css('font-family','open sans condensed'); } }); Ignore the wonky thing I'm playing with haha that has nothing to do with my issue. My question is, how do I add more to the css() part? I can change font-family there easily, but I want to change size, color, letter-spacing, a bunch-o jazz like that and I can't figure out what the format is for adding more. I tried ('font-family','open sans condensed','font-size','13px'); and variations without the connecting commas and... well, that's definitely not it haha
Any help appreciated on adding further css bits ^^
|
|
inherit
96289
0
May 17, 2020 9:37:00 GMT -8
elli
1,822
January 2007
ebbymac
|
Post by elli on Nov 13, 2019 13:41:19 GMT -8
The .css() method in jQuery also accepts styles in the form of an object. api.jquery.com/css/$(function() { if ( pb.data('route').name.match(/edit_user/) ) { $( ".description:contains('Your current email address is:')" ).next().next().next().css({ "font-family": "open sans condensed", "font-size": "13px", }); } }); Would also recommend something other than .next().next().next() to select this element, though. Look into the .find() method instead.
|
|
inherit
223470
0
Feb 27, 2019 17:05:53 GMT -8
₪» ⅀ ƪ Ƒ «₪
Original registration date: 2007. DeviantART: http://deviantart.com/ruanly. Discord: Ruanly#7946.
1,281
July 2015
fajita
|
Post by ₪» ⅀ ƪ Ƒ «₪ on Nov 13, 2019 13:45:47 GMT -8
Thank you! :)
|
|