{"id":3182,"date":"2016-06-20T11:35:58","date_gmt":"2016-06-20T06:05:58","guid":{"rendered":"\/?p=3182"},"modified":"2018-06-04T15:35:34","modified_gmt":"2018-06-04T10:05:34","slug":"display-a-module-using-class-name-and-id","status":"publish","type":"docs","link":"https:\/\/convertplug.com\/plus\/docs\/display-a-module-using-class-name-and-id\/","title":{"rendered":"Display Module when User Scrolls to a certain elements on the page \u2013 Using Class name and ID"},"content":{"rendered":"<p>Available from Version 2.3.1<\/p>\n<p>ConvertPlus is a WordPress popup plugin that lets you create attractive popups and control their behavior on your website. You can decide how and when they can appear before your audiences.<\/p>\n<p>Advanced triggers like the exit intent, the after scroll, inactivity, after post and more help you display the right message at the right time.<\/p>\n<p><em>Have you ever wondered whether you could display a popup, a slide-in, or an infobar when a user reaches up to a certain element or text on the page; i.e. when a particular element or text is visible in the\u00a0view port?<\/em><\/p>\n<p><em><strong>ConvertPlus lets you do that too!<\/strong><\/em><\/p>\n<p>Suppose you have a page, with a long text, and you wish to display a separate module when a user reaches to a certain level of the content. You can do this by using the ID or class name you set for that particular element (eg: a button) or text.<\/p>\n<p>Do you wish to display a popup when the user reaches to the button seen in the image below?<\/p>\n<p><a href=\"http:\/\/convertplug.com\/plus\/wp-content\/uploads\/sites\/4\/2017\/06\/Button-on-page.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-10288 size-full\" src=\"http:\/\/convertplug.com\/plus\/wp-content\/uploads\/sites\/4\/2017\/06\/Button-on-page.jpg\" alt=\"Button On Page\" width=\"2048\" height=\"1259\" title=\"Display Module when User Scrolls to a certain elements on the page \u2013 Using Class name and ID\" srcset=\"https:\/\/convertplug.com\/plus\/wp-content\/uploads\/sites\/4\/2017\/06\/Button-on-page.jpg 2048w, https:\/\/convertplug.com\/plus\/wp-content\/uploads\/sites\/4\/2017\/06\/Button-on-page-300x184.jpg 300w, https:\/\/convertplug.com\/plus\/wp-content\/uploads\/sites\/4\/2017\/06\/Button-on-page-768x472.jpg 768w, https:\/\/convertplug.com\/plus\/wp-content\/uploads\/sites\/4\/2017\/06\/Button-on-page-1024x630.jpg 1024w\" sizes=\"auto, (max-width: 2048px) 100vw, 2048px\" \/><\/a>Add a unique class name to the button. Let us say, I have used the class name \u201c<strong>display_popup<\/strong>\u201d.<\/p>\n<p><a href=\"http:\/\/convertplug.com\/plus\/wp-content\/uploads\/sites\/4\/2017\/06\/Class-name-entered-for-button.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-10289 size-full\" src=\"http:\/\/convertplug.com\/plus\/wp-content\/uploads\/sites\/4\/2017\/06\/Class-name-entered-for-button.jpg\" alt=\"Class Name Entered For Button\" width=\"2048\" height=\"1259\" title=\"Display Module when User Scrolls to a certain elements on the page \u2013 Using Class name and ID\" srcset=\"https:\/\/convertplug.com\/plus\/wp-content\/uploads\/sites\/4\/2017\/06\/Class-name-entered-for-button.jpg 2048w, https:\/\/convertplug.com\/plus\/wp-content\/uploads\/sites\/4\/2017\/06\/Class-name-entered-for-button-300x184.jpg 300w, https:\/\/convertplug.com\/plus\/wp-content\/uploads\/sites\/4\/2017\/06\/Class-name-entered-for-button-768x472.jpg 768w, https:\/\/convertplug.com\/plus\/wp-content\/uploads\/sites\/4\/2017\/06\/Class-name-entered-for-button-1024x630.jpg 1024w\" sizes=\"auto, (max-width: 2048px) 100vw, 2048px\" \/><\/a>You can use the ID attribute in a div tag to set an ID for text.<\/p>\n<p>Let us proceed to ConvertPlus<\/p>\n<p><strong>1. Select and Customize a Module according to your needs.<\/strong><\/p>\n<p><strong>2. Open it in the Editor.<\/strong><br \/>\nClick on Behavior -&gt; Smart Launch<\/p>\n<p><strong><a href=\"http:\/\/convertplug.com\/plus\/wp-content\/uploads\/sites\/4\/2017\/06\/Smart-Launch-in-ConvertPlug.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-10291 size-full\" src=\"http:\/\/convertplug.com\/plus\/wp-content\/uploads\/sites\/4\/2017\/06\/Smart-Launch-in-ConvertPlug.jpg\" alt=\"Smart Launch In ConvertPlug\" width=\"2048\" height=\"1061\" title=\"Display Module when User Scrolls to a certain elements on the page \u2013 Using Class name and ID\" srcset=\"https:\/\/convertplug.com\/plus\/wp-content\/uploads\/sites\/4\/2017\/06\/Smart-Launch-in-ConvertPlug.jpg 2048w, https:\/\/convertplug.com\/plus\/wp-content\/uploads\/sites\/4\/2017\/06\/Smart-Launch-in-ConvertPlug-300x155.jpg 300w, https:\/\/convertplug.com\/plus\/wp-content\/uploads\/sites\/4\/2017\/06\/Smart-Launch-in-ConvertPlug-768x398.jpg 768w, https:\/\/convertplug.com\/plus\/wp-content\/uploads\/sites\/4\/2017\/06\/Smart-Launch-in-ConvertPlug-1024x531.jpg 1024w\" sizes=\"auto, (max-width: 2048px) 100vw, 2048px\" \/><\/a><\/strong><\/p>\n<p><strong>3. Enable the &#8220;<em>After Scroll to Certain ID\/ Class<\/em>&#8221; option<\/strong><br \/>\nEnter the class name prefixed with a \u201c.\u201d<\/p>\n<p><strong><a href=\"http:\/\/convertplug.com\/plus\/wp-content\/uploads\/sites\/4\/2017\/06\/Enable-Display-with-Class-name-or-ID-option-1024x529.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-10290 size-large\" src=\"http:\/\/convertplug.com\/plus\/wp-content\/uploads\/sites\/4\/2017\/06\/Enable-Display-with-Class-name-or-ID-option-1024x529.jpg\" alt=\"Enable Display With Class Name Or ID Option 1024x529\" width=\"640\" height=\"331\" title=\"Display Module when User Scrolls to a certain elements on the page \u2013 Using Class name and ID\" srcset=\"https:\/\/convertplug.com\/plus\/wp-content\/uploads\/sites\/4\/2017\/06\/Enable-Display-with-Class-name-or-ID-option-1024x529.jpg 1024w, https:\/\/convertplug.com\/plus\/wp-content\/uploads\/sites\/4\/2017\/06\/Enable-Display-with-Class-name-or-ID-option-300x155.jpg 300w, https:\/\/convertplug.com\/plus\/wp-content\/uploads\/sites\/4\/2017\/06\/Enable-Display-with-Class-name-or-ID-option-768x396.jpg 768w, https:\/\/convertplug.com\/plus\/wp-content\/uploads\/sites\/4\/2017\/06\/Enable-Display-with-Class-name-or-ID-option.jpg 2048w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/strong><\/p>\n<p><strong>Note:<\/strong> <em><strong>If you are using an ID, it should be prefixed with a \u201c#\u201d<\/strong><\/em><br \/>\n<em><strong> A class name should be prefixed with a \u201c.\u201d<\/strong><\/em><\/p>\n<p><strong>4. Save and Publish<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Available from Version 2.3.1 ConvertPlus is a WordPress popup plugin that lets you create attractive popups and control their behavior on your website. You can decide how and when they can appear before your audiences. Advanced triggers like the exit intent, the after scroll, inactivity, after post and more help you display the right message [&hellip;]<\/p>\n","protected":false},"author":23,"featured_media":0,"template":"","meta":{"inline_featured_image":false,"site-sidebar-layout":"default","site-content-layout":"default","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"docs_category":[24],"docs_tag":[],"class_list":["post-3182","docs","type-docs","status-publish","hentry","docs_category-triggers"],"_links":{"self":[{"href":"https:\/\/convertplug.com\/plus\/wp-json\/wp\/v2\/docs\/3182","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/convertplug.com\/plus\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/convertplug.com\/plus\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/convertplug.com\/plus\/wp-json\/wp\/v2\/users\/23"}],"version-history":[{"count":3,"href":"https:\/\/convertplug.com\/plus\/wp-json\/wp\/v2\/docs\/3182\/revisions"}],"predecessor-version":[{"id":22298,"href":"https:\/\/convertplug.com\/plus\/wp-json\/wp\/v2\/docs\/3182\/revisions\/22298"}],"wp:attachment":[{"href":"https:\/\/convertplug.com\/plus\/wp-json\/wp\/v2\/media?parent=3182"}],"wp:term":[{"taxonomy":"docs_category","embeddable":true,"href":"https:\/\/convertplug.com\/plus\/wp-json\/wp\/v2\/docs_category?post=3182"},{"taxonomy":"docs_tag","embeddable":true,"href":"https:\/\/convertplug.com\/plus\/wp-json\/wp\/v2\/docs_tag?post=3182"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}