{"id":21992,"date":"2018-05-25T14:57:27","date_gmt":"2018-05-25T09:27:27","guid":{"rendered":"http:\/\/convertplug.com\/plus\/?post_type=docs&#038;p=21992"},"modified":"2018-05-25T15:24:37","modified_gmt":"2018-05-25T09:54:37","slug":"use-custom-selector-id-or-class-to-trigger-popup","status":"publish","type":"docs","link":"https:\/\/convertplug.com\/plus\/docs\/use-custom-selector-id-or-class-to-trigger-popup\/","title":{"rendered":"How to use custom selector (class or id with attribute) to trigger popup?"},"content":{"rendered":"<p><highlight>Available from Version 3.3.0<\/highlight><\/p>\n<p>Have you ever wanted to open a Convert Plus module on click of any custom selector using ID or class along with any attribute?<\/p>\n<p>Let us take a look at how you can do this.<\/p>\n<p><strong>1. Create and design a module as per your needs.<\/strong><\/p>\n<p>2. Open it in the editor and move to <strong>Behaviour -&gt; Manual Display -&gt; Launch With Custom Selector<\/strong>.<\/p>\n<p>3. You can add multiple selectors to launch modal on click event.<\/p>\n<p>For eg: If your link is like this<\/p>\n<pre>&lt;a id=\"myid\" href=\"#\"&gt;Click Me &lt;\/a&gt;\r\n<\/pre>\n<p>then your selector will be same as- <strong>#myid[reference=&#8221;123&#8243;]<\/strong><\/p>\n<p>Enter the selector as shown below.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-21997\" src=\"http:\/\/convertplug.com\/plus\/wp-content\/uploads\/sites\/4\/2018\/05\/Add-custom-selector-in-Convert-Plus-editor.jpg\" alt=\"Add Custom Selector In Convert Plus Editor\" width=\"2048\" height=\"1190\" title=\"How to use custom selector (class or id with attribute) to trigger popup?\" srcset=\"https:\/\/convertplug.com\/plus\/wp-content\/uploads\/sites\/4\/2018\/05\/Add-custom-selector-in-Convert-Plus-editor.jpg 2048w, https:\/\/convertplug.com\/plus\/wp-content\/uploads\/sites\/4\/2018\/05\/Add-custom-selector-in-Convert-Plus-editor-300x174.jpg 300w, https:\/\/convertplug.com\/plus\/wp-content\/uploads\/sites\/4\/2018\/05\/Add-custom-selector-in-Convert-Plus-editor-768x446.jpg 768w, https:\/\/convertplug.com\/plus\/wp-content\/uploads\/sites\/4\/2018\/05\/Add-custom-selector-in-Convert-Plus-editor-1024x595.jpg 1024w\" sizes=\"auto, (max-width: 2048px) 100vw, 2048px\" \/>4. Save<\/p>\n<p><strong>Note:<\/strong> <em><strong>If you have used the same class with different attributes and want to open different modal for each different parameter, then it can be possible using the custom selector.<\/strong><\/em><\/p>\n<p>For eg.Link structure-<\/p>\n<pre>&lt;ul&gt;\r\n \t&lt;li class=\"myclass\" data-name=\"link1\"&gt;Link1&lt;\/li&gt;\r\n \t&lt;li class=\"myclass\" data-name=\"link2\"&gt;Link2&lt;\/li&gt;\r\n \t&lt;li class=\"myclass\" data-name=\"link3\"&gt;Link2&lt;\/li&gt;\r\n \t&lt;li class=\"myclass\" data-name=\"link4\"&gt;Link2&lt;\/li&gt;\r\n&lt;\/ul&gt;\r\n<\/pre>\n<p>If your link contains the same class, but different data-attribute and you want to open different modules on each link then you can use selectors as mentioned below.<\/p>\n<p><strong>.myclass[data-name=&#8221;link1&#8243;]<\/strong><br \/>\n<strong>.myclass[data-name=&#8221;link2&#8243;]<\/strong><br \/>\n<strong>.myclass[data-name=&#8221;link2&#8243;]<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Available from Version 3.3.0 Have you ever wanted to open a Convert Plus module on click of any custom selector using ID or class along with any attribute? Let us take a look at how you can do this. 1. Create and design a module as per your needs. 2. Open it in the editor [&hellip;]<\/p>\n","protected":false},"author":22,"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":[],"docs_tag":[],"class_list":["post-21992","docs","type-docs","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/convertplug.com\/plus\/wp-json\/wp\/v2\/docs\/21992","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\/22"}],"version-history":[{"count":1,"href":"https:\/\/convertplug.com\/plus\/wp-json\/wp\/v2\/docs\/21992\/revisions"}],"predecessor-version":[{"id":21996,"href":"https:\/\/convertplug.com\/plus\/wp-json\/wp\/v2\/docs\/21992\/revisions\/21996"}],"wp:attachment":[{"href":"https:\/\/convertplug.com\/plus\/wp-json\/wp\/v2\/media?parent=21992"}],"wp:term":[{"taxonomy":"docs_category","embeddable":true,"href":"https:\/\/convertplug.com\/plus\/wp-json\/wp\/v2\/docs_category?post=21992"},{"taxonomy":"docs_tag","embeddable":true,"href":"https:\/\/convertplug.com\/plus\/wp-json\/wp\/v2\/docs_tag?post=21992"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}