get help in general - we have more specialized help rooms here: https://gitter.im/FreeCodeCamp/home
I want to style a textarea (300x300 px) such that the fontsize adjusts dynamically on keyup. It should scale the font such that the text fills the textarea as much as possible.
What is confusing is that when I scale the font, it gets narrower, but also the height decreases, so free area below the text becomes available. What kind of logic should I implement such that the textarea is filled as much as possible both with regard to width as well as height?
var oppsArr = moves.filter(function(item) {
return ((yourMoves & item) | (oppsMoves & item)) === 0b000000000;
});
index = Math.floor(Math.random() * oppsArr.length);
oppsMoves += oppsArr[index];
$("#" + index).text(opp);
burinson sends brownie points to @happyviki :sparkles: :thumbsup: :sparkles:
:cookie: 309 | @happyviki |http://www.freecodecamp.com/happyviki
moves[moves.indexOf(oppsArr[index])]
would solve everything…but alas :(
moves.indexOf(oppsArr[index])
seemed to do it.
append
? Just use your html
tag that you already have.
click
caller thingy
on click
thing. Name the function whatever you want and then call it both in the onclick
and outside.
function reset() {
var yourMoves = 0b000000000;
var oppsMoves = 0b000000000;
$(".box").text("");
}
function reset() {
var yourMoves = 0b000000000;
var oppsMoves = 0b000000000;
console.log("reset!",((yourMoves & moves[0]) | (oppsMoves & moves[0])) ===
0b000000000)
$(".box").text("");
}
<script type="text/javascript">
$(document).ready(function() {
//add whatever function here
});
</script>
<head></head>
, normally
@shivamg11000
<form
onSubmit={()=>store.dispatch({
//your code
<form
onSubmit={store.dispatch({
that's what's stopping the app running
timjavins sends brownie points to @thekholm80 :sparkles: :thumbsup: :sparkles:
:star2: 1386 | @thekholm80 |http://www.freecodecamp.com/thekholm80
cholesterol
timjavins sends brownie points to @janshah :sparkles: :thumbsup: :sparkles:
:cookie: 480 | @janshah |http://www.freecodecamp.com/janshah
<script>
tag right before </body>
so you don't need window.onload.
If you need to wait for window load
You dont need to wait for window load 99% of the time.
[BTW, window.onload is bad
<nav class="navbar navbar-light navbar-default navbar-static-top"><div class="container"><a href="#" class="navbar-brand">Mike Batista</a><ul class="navbar-nav inline-block"><li class="nav-item active"><a href="#projectsheader">Projects</a></li><li class="nav-item active"><a href="#publishedheader">Published Work</li>
<li class="nav-item active"><a href="#contactheader">Contact</li></ul></div></nav>
happyviki sends brownie points to @thekholm80 :sparkles: :thumbsup: :sparkles:
:star2: 1387 | @thekholm80 |http://www.freecodecamp.com/thekholm80
what’s react?
:D
it's the entrance to the rabbit hole
thekholm80 sends brownie points to @timjavins :sparkles: :thumbsup: :sparkles:
:cookie: 124 | @timjavins |http://www.freecodecamp.com/timjavins
happyviki sends brownie points to @timjavins :sparkles: :thumbsup: :sparkles:
:cookie: 125 | @timjavins |http://www.freecodecamp.com/timjavins
timjavins sends brownie points to @thekholm80 and @happyviki :sparkles: :thumbsup: :sparkles:
:cookie: 311 | @happyviki |http://www.freecodecamp.com/happyviki
:star2: 1388 | @thekholm80 |http://www.freecodecamp.com/thekholm80
happyviki sends brownie points to @darrenfj :sparkles: :thumbsup: :sparkles:
:star2: 1937 | @darrenfj |http://www.freecodecamp.com/darrenfj
that worked?
@DarrenfJ I think updating the github thing on the freecodecamp page helped thanks duuuuuude :)
sorry darrenfj, you can't send brownie points to yourself! :sparkles: :sparkles:
happyviki sends brownie points to @timjavins :sparkles: :thumbsup: :sparkles:
:warning: happyviki already gave timjavins points
darrenfj sends brownie points to @timjavins and @thekholm80 :sparkles: :thumbsup: :sparkles:
:cookie: 126 | @timjavins |http://www.freecodecamp.com/timjavins
:star2: 1389 | @thekholm80 |http://www.freecodecamp.com/thekholm80
break;
happened.
But we broke up. Our relationship was a loop…and then a break;
happened.
goto:
manish-giri sends brownie points to @happyviki :sparkles: :thumbsup: :sparkles:
:cookie: 312 | @happyviki |http://www.freecodecamp.com/happyviki
<style>
$text-color : red;
.header{
text-align: center;
},
.blog-post h2 {
color: $text-color;
}
</style>
<h1 class="header">Learn Sass</h1>
<div class="blog-post">
<h2>Some random title</h2>
<p>This is a paragraph with some random text in it</p>
</div>
<div class="blog-post">
<h2>Header #2</h2>
<p>Here is some more random text.</p>
</div>
<div class="blog-post">
<h2>Here is another header</h2>
<p>Even more random text within a paragraph</p>
</div>
"don't touch the code above the line"
; just change the code below the line
functionWithArgs(1,2)
here you are directly passing in the values to the functions. you need to pass variables instead. like functionWithArgs(c,d)
also you need to sum them meaning console c+d
functionWithArgs(a, b) {
console.log(a + b);
}
:bulb: to format code use backticks! ``` more info
cykins4good sends brownie points to @ramseynjire and @saninmersion :sparkles: :thumbsup: :sparkles:
:cookie: 202 | @ramseynjire |http://www.freecodecamp.com/ramseynjire
:cookie: 534 | @saninmersion |http://www.freecodecamp.com/saninmersion
myVar is not defined
.
each of these would have to have their own reducer function
yes
knight2 sends brownie points to @manish-giri :sparkles: :thumbsup: :sparkles:
:star2: 6331 | @manish-giri |http://www.freecodecamp.com/manish-giri
<input type="text" data-lang="it" />
.dateDropper()
on a specific input
<input type="text" id="diomed"/>
$('#diomed').dateDropper();
name
too
<input id="message_id" name="message_name" type="text" />
getElementsByName('message_name')[0]
diomed sends brownie points to @manish-giri :sparkles: :thumbsup: :sparkles:
:star2: 6332 | @manish-giri |http://www.freecodecamp.com/manish-giri
id
cykins4good sends brownie points to @sonimadhuri :sparkles: :thumbsup: :sparkles:
:cookie: 340 | @sonimadhuri |http://www.freecodecamp.com/sonimadhuri
diomed sends brownie points to @alexanderkopke :sparkles: :thumbsup: :sparkles:
:star2: 1630 | @alexanderkopke |http://www.freecodecamp.com/alexanderkopke
The font-weight Property
You can also define the font weight with a number from 100 (thin) to 900 (thick), according to how thick you want the text to be.
400 is the same as normal, and 700 is the same as bold.
The HTML:
<p class="light">This is a font with a "lighter" weight.</p>
<p class="thick">This is a font with a "bold" weight.</p>
<p class="thicker">This is a font with a "700" weight.</p>
The CSS:
p.light {
font-weight: lighter;
}
p.thick {
font-weight: bold;
}
p.thicker {
font-weight: 700;
}
<p class="small">Paragraph text set to be small</p>
<p class="medium">Paragraph text set to be medium</p>
<p class="large">Paragraph text set to be large</p>
<p class="xlarge">Paragraph text set to be very large</p>
<link= "stylesheet" href "fontsize.css">
<link rel= "stylesheet" href= "fontsize.css">
thekholm80 sends brownie points to @vittoriovt :sparkles: :thumbsup: :sparkles:
:cookie: 807 | @vittoriovt |http://www.freecodecamp.com/vittoriovt
Website facts: HTML <= 160 lines | CSS < 430 lines | JS < 40 lines | Love > 9000
@daddycardona this was a bit confusing so I was suggesting using the console to see any issues you may be experiencing when trying to use the API that was suggested. There should be no reason you need to look at the codepen source code...
I don't get how to use it am I suppose to look at the codepen source code due to the fact the pen did nothing? That is just confusing to me
<script> https://fcc-weather-api.glitch.me/</script>
and I don't understand what it means by endpoints I am tryting to understand that searching google.
src=
then close script
abdel974 sends brownie points to @cmccormack :sparkles: :thumbsup: :sparkles:
:star2: 1073 | @cmccormack |http://www.freecodecamp.com/cmccormack
$.getJSON('https://fcc-weather-api.glitch.me/...', callback);
abdel974 sends brownie points to @daddycardona :sparkles: :thumbsup: :sparkles:
:cookie: 291 | @daddycardona |http://www.freecodecamp.com/daddycardona
function convertHTML(str) {
var symbols = ["&", "<", ">", """, "'"]
var signs = ["&", "<", ">", "\"", "'", ]
// :)
var sentence = str.split("");
console.log("first sentence: " + sentence);
for (var i = 0; i < sentence.length; i++) {
for (var j = 0; j < signs.length; j++) {
if (sentence[i] === signs[j]){
sentence = str.replace(sentence[i], symbols[j]);
}
}
}
console.log(sentence);
return sentence;
}
convertHTML("Hamburgers < Pizza < Tacos");
var newSentence = str.replace(sentence[i], symbols[j]);
@SydneyWarren
$('#tweetQuote').on("click", function () {
var textToTweet = $(".message").text();
if (textToTweet.length > 140) {
alert("Over Twitter character capacity!")
}
var twtLink = 'https://twitter.com/home?status=' +encodeURIComponent(textToTweet);
window.open(twtLink,'_blank');
});
});
Why doesn't this open a new window, with a Tweet and the quote of my random quote generator?
<a target="_blank">
<button id =¨tweetQuote¨ class="btn btn-primary"><i class="fa fa-twitter" aria-hidden="true"></i></button></a>
<a target="_blank">
<button id="tweetQuote" class="btn btn-primary"><i class="fa fa-twitter" aria-hidden="true"></i></button></a>
id =
annnd your quotes around "tweetQuote" are different character
¨tweetQuote¨
vs "tweetQuote"
burinson sends brownie points to @johntendik :sparkles: :thumbsup: :sparkles:
:cookie: 798 | @johntendik |http://www.freecodecamp.com/johntendik
mahdi0123 sends brownie points to @thekholm80 :sparkles: :thumbsup: :sparkles:
:star2: 1390 | @thekholm80 |http://www.freecodecamp.com/thekholm80
Hi there! I have this peace of code
function smallestCommons(arr) {
function check(divisors, num) {
for(var x in divisors) {
if(num % divisors[x] !== 0) {
return false;
}
}
return true;
}
var smaller = arr[0] < arr[1] ? arr[0] : arr[1];
var bigger = arr[0] > arr[1] ? arr[0] : arr[1];
var divisors = [];
var num = bigger;
for(i = smaller; i <= bigger; i++)
divisors.push(i);
while(!check(divisors,num))
num++;
return num;
}
smallestCommons([1,5]);
My problem is that the while loop ends despite 'ok' being false. This only happens if I use this code on the fcc challenge section where I have to write it. If I try it in the dev console it works fine. What may be causing this? ( https://www.freecodecamp.com/challenges/smallest-common-multiple )
sudha533 sends brownie points to @korzo :sparkles: :thumbsup: :sparkles:
:cookie: 313 | @korzo |http://www.freecodecamp.com/korzo
brianquiroz216 sends brownie points to @thekholm80 :sparkles: :thumbsup: :sparkles:
:star2: 1391 | @thekholm80 |http://www.freecodecamp.com/thekholm80
ldocherty1 sends brownie points to @dhcodes :sparkles: :thumbsup: :sparkles:
:star2: 1809 | @dhcodes |http://www.freecodecamp.com/dhcodes