Change value on element click JavaScript - javascript

We have a widget in our Magento page which allows us to show some featured products. But what our main goal is, is that we want to change the featured products when an element is clicked, here is what the widget looks like in code:
{{widget type="slideshow/slideshow" slideshow_ids="16,17,18,19,20" template="ma2_slideshow/slideshownews.phtml"}}
The id's which the widget uses, needs to be changed when an element is clicked.
I've already searched and fiddled with some variables but it doesn't work unfortunately...
I am also wondering what type of language the widget is...
Any more information needed? Any suggestions?

Related

How to make a product page in Wordpress

I am learning Wordpress currently so far I know how to design the webpage, but what I want to do next is to make a product page without ordering. What I want is the following:
List all my products and if one clicks on a product it will show the detail page of that product
The products can be added to a list and then there will be a contact form which will take the list and send it to me in a pdf or excel (but at first enough if only names are sent via email) so I can answer it with the asked question.
I sadly could not find any starting point I do not even know if there is such a plugin, if not can I make one myself? I know javascript so I think I could Programm it myself but would prefer if there is some plugin I can use due to time issues.
You can also use woocommerce. If you don't want a user to order something with a "Add to cart" button you could hide this button with your code or a pluging for example https://de.wordpress.org/plugins/yith-woocommerce-catalog-mode/

local visible text search on current web page

I need to do a local search visible text on a single simple html page. Users can simply use Ctrl+F to do that, but I would like to add a search box on the page to do the search instead. I thought of a couple ways to do this:
1- By forcing the browser's Find tool when a button on the page is clicked.
2- By a javascript/Jquery plugin that do LOCAL search on the current page.
I searched for both solutions but was not able to find anything useful. Does anyone here have any suggestions?
You can give a common class name to the tags that contains the display text and perform a search based on that class name. I had attached a link for your reference. you can make use of that funtion and call that function from a button click.
Generic Search in HTML Page

Getting specific content from TinyMCE editor

I have a plugin im building for wordpress that injects a shortcode with content inside it after the user selects options for that plugin. What im having trouble with is tinyMCE.get('content').getContent() this is called when a user wants to update those options but using this pulls everything thats in tinymce, I need it limited to the content inside the shortcode open and close tags. For example: after a user selects options of the plugin, a shortcode of [plugin]---HTML OPTIONS---[/plugin] will be created but when tinyMCE.get('content').getContent() is called I need it to grab everything inside of said plugin tags and nothing else like so: [plugin]---GET THIS CODE----[/plugin] any help would be grateful. Let me know if you need clarification on anything.
If I understand what you are attempting then what you are looking for is the
tinymce.dom.Selection class (doc)
More specifically:
// Sets some contents to the current selection in the editor
tinymce.activeEditor.selection.setContent('Some contents');
// Gets the current selection
alert(tinymce.activeEditor.selection.getContent());
You might take a look at code in some of the available plugins. The link plugin in particular works with text selections.

What is the html container or element on the mymsn pages?

If you log in to mymsn, you are able to customize the content and layout of your webpage. What I want to know is what kind of container are they using? Do they use an html element, or is it javascript or something else?
There are a bunch of boxes with a title, menu option, and minimize and delete buttons. Inside the boxes are unordered list links to topics of that particular subject.
Since I don't have 10 reputation I can't post an image of what it looks like.
If you look at the source code, you can see that this is just HTML elements like div used as containers for all the news dynamically added via JavaScript.
Check it by right clicking on any element in the page and select inspect element, you will see all the scripts running the page and handling interactions.

Fetching product details on mouseover

I want to integrate a function into my website, whereby if a user hovers their mouse on the name of a product, a box appears which will show the details of this product. For this I would preferably like to use either CSS or Javascript, I am not really sure how I would go about doing this though. Can anyone offer me some guidance please? I am currently using the JQuery UI with essentially the same code as the shopping cart code seen here :
http://jqueryui.com/demos/droppable/#shopping-cart
Thnk you very much for the help.
If you want to be fancy and use jquery, here is a list of popup plugins that you can browse.
If the product information isn't too complicated I would suggest using CSS as it is simpler. Also, you probably want to have the data already loaded, so the user doesn't have to wait a round trip to your server every time they mouse over a product. Here is a simple CSS popup tutorial.

Categories