Just Another Random Quote Machine

Just Another Random Quote Machine
0

#1

I feel like I’m getting really close to meeting all requirements, but I can’t seem to properly capture the quote displayed when I use the “Tweet” button…

http://codepen.io/jscogg/pen/jAoExN

EDIT: Tweet button functioning properly now. I’m not sure about the positioning, but I can figure that out later. :stuck_out_tongue_winking_eye:


#2

Nice implementation. My note - try to remove horizontal scrolling


#3

You need dynamically load text to data-text for ur tweet button as user click on button next
Current u load that text into ur tweet button once, as page load


#4

Well, I changed the code to remove any existing twitter buttons once the NEXT button is clicked and then added the code that renders the button to the sendAJAX(); function so that it fires every time the ajax function does. Unfortunately, it’s loading the data-text of the quote previously displayed instead of the quote currently displayed. :slight_frown:


#5

You need to asign data to ur tweet button in
xhr.onreadystatechange
cause AJAX is async operation


#6

YES! That’s the ticket! I’ve fixed it now. :grinning:


#7

Hmm… the embed is the only thing that has the horizontal scrolling for me (testing using the responsive features in Chrome Dev Tools). I wonder why…


#8

I tried to change
width: 100vw to width: 100%;
to html, body and those two containers
and it works


#9

I wonder why it makes a difference… huh… :confounded:


#10

Do u see when u set 100 vw
*tried in google chrome
if u set focus in ur dev tools on html
it contains and scroll bar to the right side

but when it is 100%
it doesn’t?

100 vw - means 100 ‘%’ of viewport no metter what