portfolio/src/main/webapp/script.js
/**
 * Show the full blog post text for blog post div with the given ID.
 * @param {String} blogId ID of the div of the blog post to be shown.
 * @returns none
 */
Show the full blog post text for blog post div with the given ID.
@param {String} blogId ID of the div of the blog post to be shown.
@returns none
Show the full blog post text for blog post div with the given ID . @param { String } blogId ID of the div of the blog post to be shown . @returns none
function toggleBlogPost(buttonId) {
  var blogDivId = buttonId.slice(0, buttonId.length-2);
  var content = document.getElementById(blogDivId);
  var button = document.getElementById(buttonId);
  if (content.style.display === 'none' || content.style.display === "") {
    content.style.display = 'block';
    button.innerHTML = 'Read less';
  } else {
    content.style.display = 'none';
    button.innerHTML = 'Read more';
  }
}
function toggleBlogPost ( buttonId ) { var blogDivId = buttonId . slice ( 0 , buttonId . length - 2 ) ; var content = document . getElementById ( blogDivId ) ; var button = document . getElementById ( buttonId ) ; if ( content . style . display === 'none' || content . style . display === "" ) { content . style . display = 'block' ; button . innerHTML = 'Read less' ; } else { content . style . display = 'none' ; button . innerHTML = 'Read more' ; } }
Show the full blog post text for blog post div with the given ID.
Show the full blog post text for blog post div with the given ID .
// Remove the '-b' from the button ID to get the ID of div of blog post. // Change the label in the button accordingly to what button will do