I bought this plugin for my wordpress site:
and I want to round pictures. I mean, if friends upload a photo or use
facebook to add photos, those photos should be round like here:
I dont know how to add this code to the plugin. I’m only familiar with
HTML/ CSS. I thought I may search for “img” tags and add a css code
but It doesnt work for me.
Please if you are an expert have a look !
I cant upload files here, but I found a website which uses the plugin and where you can find the related file: kooga.co.nz/wordpress/wp-content/plugins/fancy-product-designer/js/
Have you considered just using CSS
I tried but I really dont know where. The plugin developer told me to work with the “add element” method but I dont know how to do this.
It’s as simple as this:
You could do that to every image, or add a special class to the images it needs to apply to and target that class.
What I want is just, when people upload an image or add an image via facebook those images should be round.
and sorry for my english.
To apply it to more images just give those images the same class.
There will need to be something unique about the Facebook images so that you can easily target them in CSS. If they had a particular class, that would make it really easy. But if not, there are other options. For example, if the image URLs include the word “facebook”, for example, you could target that with CSS.
So, what do the relevant
img elements look like? Can you show some examples?
thanks for the support! It seems to be easy but I still dont know how to do it. Maybe I couldnt explain exactly what I want.
- The Plugin for Woocomerce I purchased is this one:
It is a product designer. People can add own pictures (either upload it or use facebook).
- I’m using the Plugin just to create a collage
But the pictures uploaded should be round! Like here:
People will upload images to you site. They will look something like this:
<img src="1.jpg" alt="">
<img src="2.jpg" alt="">
<img src="3.jpg" alt="">
If you want them to look round, just add one simple line to your CSS file. (No JS needed!)
Now, you may not want all images on your site to look round, so in that case, you’ll have to target just the uploaded images. How? You could do it just with CSS (no JS!—remember, it’s in a hole). But you need a way to target just those images. If they have a unique class, that would be great—but we don’t know if they do, because you won’t tell us. Or maybe they have something unique in their URL. Again, we need to know to be able to help with the CSS.
where the hell are those html-tags
If I use firebug and try to catch the uploaded image I get something with canvas!
Ah, if canvas is involved, then that’s a different situation. Personally, I’d look for a backend uploading system that added the images to your HTML, but I guess that’s up to you.
Perhaps post a demo to a page that has the images in place. Then perhaps the JS guys can suggest what to do next.
Its not possible to have the images in place. You have to upload them on your own
So where are the JS guys! I lost my shovel
Is there no way to use CSS to target the
It’s more about targeting what’s in it, which you can’t do with CSS.
@hello2—I see the first link you posted in your original post links to the plugin page, which is effectively a demo. It’s a pity it doesn’t come with any documentation.
Have you looked for other WP add-ons that don’t involve canvas? I think it would give you a lot more options.
Yeah, I’ve been looking at the JS. I had originally pictured users just uploading images, but clearly there’s a more elaborate need here. Just wasn’t quite clear from the beginning. It certainly would need to JS customization to set the images to look round.
Maybe the likes of @Paul_Wilkins @felgall @James_Hibbard have some suggestions here.
I’m not familiar with that plugin nor fabric but from what I gather the event system in fabric could be used to do this. When the canvas is created you would add an event listener for object:added that applies rounded corners to images. The practicality of this approach would also be dependent on how/if the wp plugin itself provides a means of intercepting fabric when a new instance is created. Perhaps you could ask the plugin author whether there is an event that allows you to modify fabric canvas when it is instantiated within the wp plugin js code. There might also be a better means of doing this via the wp plugin itself rather than interacting with fabric js. Though I can only go off the documentation that is freely available to the public. Does that plugin have any documentation in terms of internal events or how it interacts with fabric?
I took a gander at the source code for the plugin js. I found an event that gets triggered from the plugin itself when an element is added.
So the next step is to figure out what $elem represents and if you can apply your own custom event listener to apply the rounded corners when an image from facebook is loaded.