Created
November 12, 2024 20:33
-
-
Save felipeabajo/b93588cfd5c039366d540efdcf38a8dc to your computer and use it in GitHub Desktop.
String replacement with media queries in jQuery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function( $ ){ | |
if (window.matchMedia('(min-width: 767px)').matches) { | |
var test = jQuery(".hide-text:nth-of-type(2)").html(); jQuery(".hide-text:nth-of-type(2)").html(test.replace('text','')); | |
var test = jQuery(".hide-text:nth-of-type(1)").html(); jQuery(".hide-text:nth-of-type(1)").html(test.replace('text','')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment