Quote Gen Tweet Button help

Hey all!
I know I’m super close on my super-noughty’s-trash Buffy tweet generator. I just need to figure out what’s going on with my Tweet button that doesn’t work. Then I can work to make it just a touch less… trashy…

Thanks for taking a look :slight_smile:

Why not try background-size: auto;?

For the tweet:

 $('#tweet-this').click(function() {
      var tweetJoke = $(".message").text();
      if (tweetJoke != 'Press below for a joke') {
        window.open('https://twitter.com/intent/tweet?text="' + tweetJoke + '"', '_blank');
      };
    });

Is there an easy way without jquery? I’m not super clear how this fixes it in context.

Vanilla JS:

function tweetQuote(){
  var msg =  document.getElementById('quoteBox').textContent;
  if (msg != "Get yourself some Buffy Love")
    window.open('https://twitter.com/intent/tweet?text="' + msg + '"', '_blank');
}  
1 Like

Yaasss thank you!

I’ve done jquery but I want to practice more in vanilla. Thank you for showing me it in action.

1 Like

Also re: background-size -
I wanted to be sure the Buffy logo on the right was still showing. in “background-size: auto” it wasn’t doing that. I stole this format from CSStricks, since it supposedly works with all browsers.