Open MrZesty opened 9 years ago
What about arrowMarkup
? Look in the docs: http://dimsemenov.com/plugins/magnific-popup/documentation.html#gallery
I have tried that, it doesn't seem to work. I put in this:
gallery: {
enabled: true,
preload: [1,2],
arrowMarkup: '<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"><img src="images/portfolio_next.png" width="18" height="15"/></button>'
},'
but it seemed to have no effect. Also I am not sure how to have a different image for Next vs. Previous with this type of syntax that seems to effect both.
Maybe you have to try it with CSS and overwrite .mfp-arrow-left and .mfp-arrow-right?
This example customizes everything, it's in the docs. See the CSS. http://codepen.io/mgo/pen/ykgjb
For everybody still looking for an easy solution to this, try the following:
.mfp-arrow-left { background:url(../images/large_left.png) no-Repeat top left !important; width:40px; height:40px; } .mfp-arrow-right { background:url(../images/large_right.png) no-Repeat top left !important; width:40px; height:40px; } .mfp-arrow-left::before, .mfp-arrow-right::before { display: none; }
You may have to move the buttons around a little. @sirswagalot, you suggestion sounds very straight forward, but, unfortunately, for me, no dice.
an update to @sirswagalot 's code, this works good & looks perfect
button.mfp-close, button.mfp-arrow{
height: 70px !important;
}
.mfp-arrow-left {
background: url(data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTkuMS4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4PSIwcHgiIHk9IjBweCIgdmlld0JveD0iMCAwIDQ3Ny4xNzUgNDc3LjE3NSIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgN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R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgNDc3LjE3NSA0NzcuMTc1OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIgd2lkdGg9IjY0cHgiIGhlaWdodD0iNjRweCI+CjxnPgoJPHBhdGggZD0iTTM2MC43MzEsMjI5LjA3NWwtMjI1LjEtMjI1LjFjLTUuMy01LjMtMTMuOC01LjMtMTkuMSwwcy01LjMsMTMuOCwwLDE5LjFsMjE1LjUsMjE1LjVsLTIxNS41LDIxNS41ICAgYy01LjMsNS4zLTUuMywxMy44LDAsMTkuMWMyLjYsMi42LDYuMSw0LDkuNSw0YzMuNCwwLDYuOS0xLjMsOS41LTRsMjI1LjEtMjI1LjFDMzY1LjkzMSwyNDIuODc1LDM2NS45MzEsMjM0LjI3NSwzNjAuNzMxLDIyOS4wNzV6ICAgIiBmaWxsPSIjRkZGRkZGIi8+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPC9zdmc+Cg==) no-Repeat top right !important;
width: 50px;
height: 50px;
}
.mfp-arrow-left::before,
.mfp-arrow-right::before {
display: none;
content:''
}
.mfp-arrow-left::after,
.mfp-arrow-right::after {
display: none;
content:''
}
Great piece of code @sarfraaz-sweven.
How did you code the svg+xml arrows?
I am trying to open the lightbox with a white background so need the arrows to be grey and then black when hovered.
Maybe not the best solution but can decode the base64 string on base64encode.org, change the colour, reencode, and replace the string.
I found the code to change the close button to a custom image:
but I cannot seem to figure out similar code that works for the next and previous buttons. Has anyone got something similar, or is there a preference somewhere?