Quantcast
Channel: User Brett Merrifield - Stack Overflow
Browsing all 37 articles
Browse latest View live

Comment by Brett Merrifield on TypeError: _this.state.answers.push is not a...

Try using the prevState classback for setState when comparing to the current state. For example: this.setState(prevState => ({ answers: [ ...prevState.answers, { answerChoice: '', key: uuid() } ] }));

View Article


Comment by Brett Merrifield on Unable to read...

Does it actually not work or are you just getting type errors?

View Article


Comment by Brett Merrifield on Can I see specifically what React's diffing...

If you use the react dev-tools it should highlight what updates in the dom when an update happens. Maybe you can try adding a unique key to your element so react knows it is the same from the previous...

View Article

Comment by Brett Merrifield on Change Set State in Component Life Cycle React Js

What you're looking for is the onChange event when you change the option in a dropdown list. onChange should then call setState. stackoverflow.com/questions/28868071/…

View Article

Comment by Brett Merrifield on Meeting multiple conditions that aren’t set...

One method I can think of that can solve this is to combine your two ajax requests in a Promise.all. Pretty much, your app will wait for both ajax requests to finish and then you can update your...

View Article


Comment by Brett Merrifield on onMouseOver event not working in React

Try wrapping the <Gallery /> in a <div> and put the mouseOver/mouseEnter on the div instead.

View Article

Comment by Brett Merrifield on How to Do ES 6 Arrow for Event Handlers with...

Its a function that returns a function. When you do onClick={this.handleClick(param1)} it returns onClick={(e) => { ... }} but with your params in scope for the function to use

View Article

CSS Background for a div will only display color, not the image

When I apply a CSS background to my div tag, the color will work but the background-image will not display.I want the background-image to be repeated across the bottom of my divs, but even if I only...

View Article


Put another website's RSS feed into my website [duplicate]

Possible Duplicate:How to display RSS feeds from other sitesWhat I want: I want a "news feed" on my website. This feed will display updated news from a news website. All I want is the title, date, and...

View Article


Answer by Brett Merrifield for How to use the css height attribute for...

Instead of using a height of 200px on the div, try a max-height of 200px;<div style="max-height:200px;overflow:auto;">http://jsfiddle.net/d42CA/

View Article

Javascript/Jquery if statement and hasClass

I have a bunch of images that have an opacity of 80%.When I hover over the image, I use mouseenter and fadeTo('fast' 1); to make the opacity 100%.When I hover away from the image, I use mouseleave and...

View Article

Cleanup my javascript using a function

I have javascript code that pretty much does the same thing many times. Is there a way to make a function to clean this up a little bit?The two things I'd like to make into a function...

View Article

jQuery, navigation-like styled links [closed]

Take a look at the grey StackOverflow links at the top of this page. The ones that are to the right of the logo. They say "Questions", "Tags", "Users", "Badges", and "Unanswered". Notice how the...

View Article


Why is addClass and removeClass breaking my jQuery?

$('.selected').removeClass('selected');$(this).addClass('selected');Before adding the 2 lines of code above, the whole function worked. Now only those two lines work when I click and the rest of my...

View Article

Variable width won't change after browser resize

I have two li's which, by using javascript, is the same width of a certain li. The li is fluid css so it changes according to the browser width. The li becomes the same width as the other li when I...

View Article


Jquery add class if a element exists within div

I want Jquery to add a class .pointer to .staff-container if <a href=""> exists within .staff-picture.My Jquery:if($('.staff-container').find('.staff-picture').closest('a').length) {...

View Article

Javascript/Jquery - Don't repeat yourself

I've seen this so many times on the internet. People say to don't repeat yourself in programming languages. I wrote this script for my webpage but I repeated myself quite a bit.Is it really that big of...

View Article


JQuery/Javascript Function breaks $(this) (I think)

I was refactoring my code (I think refactoring is the right word), so I used a function so I wouldn't repeat myself so much. But I think the function messed up my $(this).The part of my code thats...

View Article

Answer by Brett Merrifield for displaying the CSS Box model boundaries around...

1.) Download the latest version of firefox.2.) Right click anywhere on a page > Inspect Element.3.) Click on the 3d cube button on the bottom right.This will show every element on the page stacked...

View Article

Answer by Brett Merrifield for How to implement responsive web design and its...

Read up on media queries to change css according to browser width or height.Include viewport to make your webpages on mobile devices scale correctly.

View Article
Browsing all 37 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>